@ControllerAdvice public class DefaultExceptionHandler extends Object
| 构造器和说明 |
|---|
DefaultExceptionHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
ErrorResponse |
notFound(me.javaroad.common.exception.DataNotFoundException e) |
ErrorResponse |
notSupported(org.springframework.web.HttpRequestMethodNotSupportedException e) |
ErrorResponse |
serverError(Exception e) |
ErrorResponse |
validationError(Exception e) |
@ExceptionHandler(value={org.springframework.web.method.annotation.MethodArgumentTypeMismatchException.class,org.springframework.web.bind.MethodArgumentNotValidException.class})
@ResponseBody
public ErrorResponse validationError(Exception e)
@ExceptionHandler(value=me.javaroad.common.exception.DataNotFoundException.class) @ResponseBody public ErrorResponse notFound(me.javaroad.common.exception.DataNotFoundException e)
@ExceptionHandler(value=org.springframework.web.HttpRequestMethodNotSupportedException.class) public ErrorResponse notSupported(org.springframework.web.HttpRequestMethodNotSupportedException e)
@ExceptionHandler(value=java.lang.Exception.class) @ResponseBody public ErrorResponse serverError(Exception e)
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.