AsyncTask which allows to handle exceptions on UI
First of all, a few notes:


ResultHolder&lt;Result&gt; can be a public static class.
This just feels wrong:

catch (Throwable e) {
    new ResultHolder&lt;Result&gt;(e);
    return null;
}


You should probably return that ResultHolder, shouldn't you?
Avoid @SuppressWarnings({"UnusedDeclaration"}). If you have a warning there, then find out why it is there and solve it. Don't mark it as ignored. Sometimes, marking warnings ignored this way is fine, I would never do it with an UnusedDeclaration warning though.


As for your question about the Throwable, you are right that it is not a good idea to use that there. You can solve this by wrapping the exception in another.

public class AsyncException extends Exception {
    public AsyncException(String message, Throwable cause) {
        super(message, cause);
    }
}


And then:

public abstract Result doInBackground(Params ... params) throws AsyncException;

public Result getResult() throws AsyncException {

private ResultHolder(AsyncException throwable) {

@Override
protected ResultHolder&lt;Result&gt; doInBackground(Params... params)  {
    try {
        return new ResultHolder&lt;Result&gt;(AsyncTaskWithThrowable.this.doInBackground(params));
    }
    catch (Exception e) {
        return new ResultHolder&lt;Result&gt;(new AsyncException("Error while performing doInBackground", e));
    }
}


Problem solved! Note that I changed to catching Exception instead of Throwable as Errors (throwables that are not exceptions) shouldn't really be caught, they are much more serious so they are meant to crash everything.