Skip to content

Conversation

@ejona86
Copy link
Member

@ejona86 ejona86 commented Aug 4, 2016

No description provided.

log.log(Level.SEVERE, "Exception while executing runnable " + task, t);
throw t instanceof RuntimeException ? (RuntimeException) t : new RuntimeException(t);
Throwables.propagateIfPossible(t);
throw new AssertionError(t);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will either be an Exception or a raw Throwable (or a subclass of Throwable that isn't RE or E).

Is wrapping in an AE appropriate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only classes that are unchecked is RuntimeException and Error (and children). So getting to this line should not be possible (without hacks). So AssertionError seems fitting.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be dumb, but won't all checked exceptions reach that point?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happened to discuss offline. run() declares no checked exceptions.

@carl-mastrangelo
Copy link
Contributor

LGTM

@ejona86 ejona86 merged commit d394cef into grpc:master Aug 4, 2016
@ejona86 ejona86 deleted the no-wrap-error branch August 4, 2016 21:27
@ejona86 ejona86 added the TODO:backport PR needs to be backported. Removed after backport complete label Aug 4, 2016
@zhangkun83 zhangkun83 removed the TODO:backport PR needs to be backported. Removed after backport complete label Sep 14, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 21, 2019
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.

3 participants