Netflix/Hystrix

Replace hystrixruntimeexception in resilience4j

rcbandit111 opened this issue · 0 comments

I have this Hystrix code which I want to migrate to resilience4j:

  @ExceptionHandler(HystrixRuntimeException.class)
  public ResponseEntity<?> handleHystrixException(HystrixRuntimeException hystrixException) {

    if (HystrixRuntimeException.FailureType.TIMEOUT == hystrixException.getFailureType()) {
      return new InternalTimeoutException();
    }
  }

I tried this:

  @ExceptionHandler(HystrixRuntimeException.class)
  public ResponseEntity<?> handleHystrixException(HystrixRuntimeException hystrixException) {

    if (hystrixException.getCause().getCause() instanceof TimeoutException) {
      return new InternalTimeoutException();
    }
  }

I can't find how to replace HystrixRuntimeException in resilience4j. Do you know how it should be replaced?