Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Propagate exceptions for submitted/scheduled tasks#727

Closed
tbruyelle wants to merge 1 commit into
androidannotations:developandroidannotations/androidannotations:developfrom
tbruyelle:646_PropagateThreadExceptionstbruyelle/androidannotations:646_PropagateThreadExceptionsCopy head branch name to clipboard
Closed

Propagate exceptions for submitted/scheduled tasks#727
tbruyelle wants to merge 1 commit into
androidannotations:developandroidannotations/androidannotations:developfrom
tbruyelle:646_PropagateThreadExceptionstbruyelle/androidannotations:646_PropagateThreadExceptionsCopy head branch name to clipboard

Conversation

@tbruyelle

Copy link
Copy Markdown
Contributor

Fix improvement for #646

For remind, the goal of #646 was to stop catching exception in @Backgound annotated methods, in order to let the user deals with it.

First shot was to simply remove the try/catch blocks, but as discussed here, there is a problem because ExecutorService.submit/schedule doesn't propagate exception during executions. This is by design. As a result, exceptions thrown are not logged and not visible.

To handle that, I suggest a solution :
Call futur.get() (in another thread pool) to check if an exception occurred during execution. If yes then throw it so it could be caught by the system.

I admit it looks like a nasty trick, but I didn't find a better solution. If someone has, I will be happy to read it.

@DayS

DayS commented Sep 20, 2013

Copy link
Copy Markdown
Contributor

This should work yes, but I still don't like this solution, even if I haven't a better idea right now :/

Note: you should update your pull-request. There are some conflicts right now

@tbruyelle

Copy link
Copy Markdown
Contributor Author

Ok I didn't know you didn't like the solution, so I finally decided to create the PR in order to up the thing.

The issue about invisible exceptions is a real problem for me because I want to keep track of all unexpected exceptions (like every java developer I presume :)). That says, I also don't appreciate a lot the solution, I hope someone could find a better one.

@DayS

DayS commented Sep 20, 2013

Copy link
Copy Markdown
Contributor

We should brainstorm on this point. In the meantime, I think we should keep this PR opened in case someone needs it.

@DayS

DayS commented Oct 18, 2013

Copy link
Copy Markdown
Contributor

We merged @JoanZapata 's PR. Thanks anyway :)

@DayS DayS closed this Oct 18, 2013
@tbruyelle

Copy link
Copy Markdown
Contributor Author

Np this is a better solution

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.