Package com.netflix.hystrix.exception.HystrixRuntimeException

Examples of com.netflix.hystrix.exception.HystrixRuntimeException.FailureType


  @ExceptionHandler(value = { HystrixRuntimeException.class })
  public final ResponseEntity<?> handleException(HystrixRuntimeException e, WebRequest request) {
    HttpStatus status = HttpStatus.SERVICE_UNAVAILABLE;
    String message = e.getMessage();

    FailureType type = e.getFailureType();

    // 对命令抛出的异常进行特殊处理
    if (type.equals(FailureType.COMMAND_EXCEPTION)) {
      status = HttpStatus.INTERNAL_SERVER_ERROR;
      message = Exceptions.getErrorMessageWithNestedException(e);
    }

    logger.error(message, e);
View Full Code Here

TOP

Related Classes of com.netflix.hystrix.exception.HystrixRuntimeException.FailureType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.