Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Extend RestErrorHandler to catch NestedRuntimeException - #1006

Merged
DayS merged 1 commit into
androidannotations:developfrom
toshe:1002_extend_resterrorhandler
May 31, 2014
Merged

DayS merged 1 commit into
androidannotations:developfrom
toshe:1002_extend_resterrorhandler

Conversation

@toshe

@toshe toshe commented May 18, 2014

Copy link
Copy Markdown
Contributor

see issue #1002 - RestErrorHandler should not be limited to RestClientException. When there is a network problem (SocketTimeoutException, HttpHostConnectException or an exception thrown by Jackson) Spring's RestTemplate automatically throws a ResourceAccessException. We should be able to handle those exceptions as well.
ResourceAccessException and RestClientException are both subclasses of NestedRuntimeException.

I have not changed the method name onRestClientExceptionThrown in order to ensure backwards compatibility. Current users implementing RestErrorHandler should not face any problems, even when catching the exceptions manually prior to handling them, since they are all subclasses of NestedRuntimeException.

@toshe toshe changed the title #1002 - extend RestErrorHandler to catch NestedRuntimeException RestErrorHandler should not be limited to RestClientException May 18, 2014
@toshe toshe changed the title RestErrorHandler should not be limited to RestClientException Extend RestErrorHandler to catch NestedRuntimeException May 18, 2014
DayS added a commit that referenced this pull request May 31, 2014
Extend RestErrorHandler to catch NestedRuntimeException
@DayS
DayS merged commit f65c1e3 into androidannotations:develop May 31, 2014
@DayS

DayS commented May 31, 2014

Copy link
Copy Markdown
Contributor

Seems legit :) Thanks for the PR

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