/** * Gets fallback action. * * @return fallback action */ protected CommandAction getFallbackAction() { return commandActions.getFallbackAction(); }
protected Observable resumeWithFallback() { if (commandActions.hasFallbackAction()) { MetaHolder metaHolder = commandActions.getFallbackAction().getMetaHolder(); Throwable cause = getExecutionException(); if (cause instanceof CommandActionExecutionException) { Object res = commandActions.getFallbackAction().executeWithArgs(executionType, args); if (res instanceof Observable) { return (Observable) res; .append(commandActions.getFallbackAction(), e).build()); throw new FallbackInvocationException(e.getCause());
/** * Gets fallback action. * * @return fallback action */ protected CommandAction getFallbackAction() { return commandActions.getFallbackAction(); }
/** *{@inheritDoc}. */ @Override protected Observable resumeWithFallback() { if (commandActions.hasFallbackAction()) { MetaHolder metaHolder = commandActions.getFallbackAction().getMetaHolder(); Throwable cause = getExecutionException(); if (cause instanceof CommandActionExecutionException) { cause = cause.getCause(); } Object[] args = createArgsForFallback(metaHolder, cause); try { Object res = commandActions.getFallbackAction().executeWithArgs(executionType, args); if (res instanceof Observable) { return (Observable) res; } else { return Observable.just(res); } } catch (Exception e) { LOGGER.error(AbstractHystrixCommand.FallbackErrorMessageBuilder.create() .append(commandActions.getFallbackAction(), e).build()); throw new FallbackInvocationException(e.getCause()); } } return super.resumeWithFallback(); }