Browse Source

500错误返回异常信息

dev
wangqing 4 years ago
parent
commit
3705c3aeb2
  1. 4
      tduck-api/src/main/java/com/tduck/cloud/api/exception/BaseExceptionHandler.java

4
tduck-api/src/main/java/com/tduck/cloud/api/exception/BaseExceptionHandler.java

@ -22,7 +22,6 @@ import org.springframework.web.servlet.NoHandlerFoundException;
public class BaseExceptionHandler {
@ExceptionHandler(NoHandlerFoundException.class)
public Result handlerNoFoundException(NoHandlerFoundException e) {
log.error(e.getMessage(), e);
@ -68,10 +67,9 @@ public class BaseExceptionHandler {
@ExceptionHandler(Exception.class)
public Result handleException(Exception e) {
log.error(e.getMessage(), e);
return Result.failed();
return Result.failed(e.getMessage());
}
}

Loading…
Cancel
Save