@Test void testResolveDetailsFromExecutionException() { Exception exception = new StubHandlerExecutionException("test", null, "Details!"); assertEquals("Details!", HandlerExecutionException.resolveDetails(exception).orElse(null)); }
public static <R> Optional<R> resolveDetails(Throwable throwable) { if (throwable instanceof HandlerExecutionException) { return ((HandlerExecutionException) throwable).getDetails(); } else if (throwable != null && throwable.getCause() != null) { return resolveDetails(throwable.getCause()); } return Optional.empty(); }
HandlerExecutionException extends AxonException { public static <R> Optional<R> resolveDetails(Throwable throwable) { if (throwable instanceof HandlerExecutionException) { return ((HandlerExecutionException) throwable).getDetails(); } else if (throwable != null && throwable.getCause() != null) { return resolveDetails(throwable.getCause()); } return Optional.empty(); } }
HandlerExecutionException extends AxonException { public static <R> Optional<R> resolveDetails(Throwable throwable) { if (throwable instanceof HandlerExecutionException) { return ((HandlerExecutionException) throwable).getDetails(); } else if (throwable != null && throwable.getCause() != null) { return resolveDetails(throwable.getCause()); } return Optional.empty(); } HandlerExecutionException(String message);  HandlerExecutionException(String message, Throwable cause);  HandlerExecutionException(String message, Throwable cause, Object details); }
HandlerExecutionException extends AxonException { public static <R> Optional<R> resolveDetails(Throwable throwable) { if (throwable instanceof HandlerExecutionException) { return ((HandlerExecutionException) throwable).getDetails(); } else if (throwable != null && throwable.getCause() != null) { return resolveDetails(throwable.getCause()); } return Optional.empty(); } HandlerExecutionException(String message);  HandlerExecutionException(String message, Throwable cause);  HandlerExecutionException(String message, Throwable cause, Object details); static Optional<R> resolveDetails(Throwable throwable); @SuppressWarnings("unchecked") Optional<R> getDetails(); }
HandlerExecutionException extends AxonException { public static <R> Optional<R> resolveDetails(Throwable throwable) { if (throwable instanceof HandlerExecutionException) { return ((HandlerExecutionException) throwable).getDetails(); } else if (throwable != null && throwable.getCause() != null) { return resolveDetails(throwable.getCause()); } return Optional.empty(); } HandlerExecutionException(String message);  HandlerExecutionException(String message, Throwable cause);  HandlerExecutionException(String message, Throwable cause, Object details); static Optional<R> resolveDetails(Throwable throwable); @SuppressWarnings("unchecked") Optional<R> getDetails();  }