Skip to content

Commit ae71d96

Browse files
committed
Merge pull request #1167 from spencergibb/execution-exception
Use getExecutionException to handle timeout, short-circuit, etc... exceptions
2 parents 12d9013 + 930ce5c commit ae71d96

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

hystrix-contrib/hystrix-javanica/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ If fallback method was marked with `@HystrixCommand` then this fallback method (
182182
}
183183
```
184184

185-
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.
185+
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.
186186

187187
Example:
188188

hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/command/AbstractHystrixCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Object process(Action action) throws Exception {
170170
*/
171171
@Override
172172
protected T getFallback() {
173-
throw new RuntimeException("No fallback available.", getFailedExecutionException());
173+
throw new RuntimeException("No fallback available.", getExecutionException());
174174
}
175175

176176
/**

hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/command/BatchHystrixCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protected List<Object> getFallback() {
7272
Object execute() {
7373
MetaHolder metaHolder = commandAction.getMetaHolder();
7474
Object[] args = toArgs(getCollapsedRequests());
75-
args = createArgsForFallback(args, metaHolder, getFailedExecutionException());
75+
args = createArgsForFallback(args, metaHolder, getExecutionException());
7676
return commandAction.executeWithArgs(commandAction.getMetaHolder().getFallbackExecutionType(), args);
7777
}
7878
});

hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/command/GenericCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected Object getFallback() {
7171
@Override
7272
Object execute() {
7373
MetaHolder metaHolder = commandAction.getMetaHolder();
74-
Object[] args = createArgsForFallback(metaHolder, getFailedExecutionException());
74+
Object[] args = createArgsForFallback(metaHolder, getExecutionException());
7575
return commandAction.executeWithArgs(commandAction.getMetaHolder().getFallbackExecutionType(), args);
7676
}
7777
});

hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/command/GenericObservableCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected Observable construct() {
8585
protected Observable resumeWithFallback() {
8686
if (commandActions.hasFallbackAction()) {
8787
MetaHolder metaHolder = commandActions.getFallbackAction().getMetaHolder();
88-
Throwable cause = getFailedExecutionException();
88+
Throwable cause = getExecutionException();
8989
if (cause instanceof CommandActionExecutionException) {
9090
cause = cause.getCause();
9191
}

0 commit comments

Comments
 (0)