@RestControllerAdvice
@ConditionalOnExpression(value="!\'${spring.application.name}\'.endsWith(\'gateway\')")
public class RExceptionHandler
extends Object
| 构造器和说明 |
|---|
RExceptionHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
R |
handleDataIntegrityViolationException(org.springframework.dao.DataIntegrityViolationException e) |
R |
handleDuplicateKeyException(org.springframework.dao.DuplicateKeyException e) |
R |
handleException(Exception e) |
void |
handleFileException(FileUploadException e) |
R |
handleNullPointerException(NullPointerException e) |
R |
handleRException(RException e)
处理自定义异常
|
R |
handlerNoFoundException(Exception e) |
@ExceptionHandler(value=RException.class) public R handleRException(RException e)
@ExceptionHandler(value=org.springframework.web.servlet.NoHandlerFoundException.class) public R handlerNoFoundException(Exception e)
@ExceptionHandler(value=org.springframework.dao.DuplicateKeyException.class) public R handleDuplicateKeyException(org.springframework.dao.DuplicateKeyException e)
@ExceptionHandler(value=org.springframework.dao.DataIntegrityViolationException.class) public R handleDataIntegrityViolationException(org.springframework.dao.DataIntegrityViolationException e)
@ExceptionHandler(value=java.lang.NullPointerException.class) public R handleNullPointerException(NullPointerException e)
@ExceptionHandler(value=FileUploadException.class) public void handleFileException(FileUploadException e)
@ExceptionHandler(value=java.lang.Exception.class) public R handleException(Exception e)
Copyright © 2019-Now–2020. All rights reserved.