You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c4e8e3d
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: AndroidAnnotations/androidannotations/src/main/java/org/androidannotations/processing/BackgroundProcessor.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ public void process(Element element, JCodeModel codeModel, EBeanHolder holder) t
61
61
executeMethod.annotate(Override.class);
62
62
63
63
JBlockrunMethodBody = executeMethod.body();
64
-
helper.surroundWithTryCatch(holder, runMethodBody, previousMethodBody, "A runtime exception was thrown while executing code in a background task");
64
+
helper.surroundWithTryCatch(holder, runMethodBody, previousMethodBody, "A runtime exception was thrown while executing code in a background task", true);
Copy file name to clipboardExpand all lines: AndroidAnnotations/functional-test-1-5-tests/src/test/java/org/androidannotations/test15/ThreadActivityTest.java
+22Lines changed: 22 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -263,4 +263,26 @@ public void cancellableSerializedBackgroundTasks() {
263
263
}
264
264
}
265
265
266
+
@Test
267
+
publicvoidpropagateException() {
268
+
BackgroundExecutor.setExecutor(newExecutor() {
269
+
@Override
270
+
publicvoidexecute(Runnablecommand) {
271
+
command.run();
272
+
}
273
+
});
274
+
try {
275
+
activity.backgroundThrowException();
276
+
Assert.fail("Exception should be propagated in @Background annotated methods");
277
+
} catch (RuntimeExceptione) {
278
+
// good
279
+
}
280
+
try {
281
+
activity.uiThreadThrowException();
282
+
Assert.fail("Exception should be propagated in @UIThread annotated methods");
0 commit comments