Skip to content

Commit

Permalink
Merge pull request #1169 from mattrjacobs/backport-1167
Browse files Browse the repository at this point in the history
Use getExecutionException to handle timeout, short-circuit, etc... exceptions
  • Loading branch information
mattrjacobs committed Apr 4, 2016
2 parents 6f55c0a + 60f417a commit 69b7682
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hystrix-contrib/hystrix-javanica/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ If fallback method was marked with `@HystrixCommand` then this fallback method (
}
```

Javanica provides an ability to get execution exception (exception thrown that caused the failure of a command) within a fallback is being executed. A fallback method signature can be extended with an additional parameter in order to get an exception thrown by a command. Javanica exposes execution exception through additional parameter of fallback method. Execution exception is derived by calling method getFailedExecutionException() as in vanilla hystrix.
Javanica provides an ability to get execution exception (exception thrown that caused the failure of a command) within a fallback is being executed. A fallback method signature can be extended with an additional parameter in order to get an exception thrown by a command. Javanica exposes execution exception through additional parameter of fallback method. Execution exception is derived by calling method getExecutionException() as in vanilla hystrix.

Example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Object process(Action action) throws Exception {
*/
@Override
protected T getFallback() {
throw new RuntimeException("No fallback available.", getFailedExecutionException());
throw new RuntimeException("No fallback available.", getExecutionException());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected List<Object> getFallback() {
Object execute() {
MetaHolder metaHolder = commandAction.getMetaHolder();
Object[] args = toArgs(getCollapsedRequests());
args = createArgsForFallback(args, metaHolder, getFailedExecutionException());
args = createArgsForFallback(args, metaHolder, getExecutionException());
return commandAction.executeWithArgs(commandAction.getMetaHolder().getFallbackExecutionType(), args);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected Object getFallback() {
@Override
Object execute() {
MetaHolder metaHolder = commandAction.getMetaHolder();
Object[] args = createArgsForFallback(metaHolder, getFailedExecutionException());
Object[] args = createArgsForFallback(metaHolder, getExecutionException());
return commandAction.executeWithArgs(commandAction.getMetaHolder().getFallbackExecutionType(), args);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected Observable construct() {
protected Observable resumeWithFallback() {
if (commandActions.hasFallbackAction()) {
MetaHolder metaHolder = commandActions.getFallbackAction().getMetaHolder();
Throwable cause = getFailedExecutionException();
Throwable cause = getExecutionException();
if (cause instanceof CommandActionExecutionException) {
cause = cause.getCause();
}
Expand Down

0 comments on commit 69b7682

Please sign in to comment.