|
@@ -1,9 +1,6 @@
|
|
package com.qmth.boot.api.exception;
|
|
package com.qmth.boot.api.exception;
|
|
|
|
|
|
-import com.qmth.boot.core.exception.ParameterException;
|
|
|
|
-import com.qmth.boot.core.exception.ReentrantException;
|
|
|
|
-import com.qmth.boot.core.exception.StatusException;
|
|
|
|
-import com.qmth.boot.core.exception.UnauthorizedException;
|
|
|
|
|
|
+import com.qmth.boot.core.exception.*;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.http.HttpHeaders;
|
|
import org.springframework.http.HttpHeaders;
|
|
@@ -52,6 +49,12 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
|
|
return handleApiException(DefaultExceptionEnum.COMMON_EXCEPTION.exception(e));
|
|
return handleApiException(DefaultExceptionEnum.COMMON_EXCEPTION.exception(e));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ExceptionHandler(NotFoundException.class)
|
|
|
|
+ public ResponseEntity<Object> handleNotFoundException(NotFoundException e) {
|
|
|
|
+ //log.error(e.getMessage(), e);
|
|
|
|
+ return handleApiException(DefaultExceptionEnum.RESOURCE_NOT_FOUND.exception(e));
|
|
|
|
+ }
|
|
|
|
+
|
|
@ExceptionHandler(Exception.class)
|
|
@ExceptionHandler(Exception.class)
|
|
public ResponseEntity<Object> handleOtherException(Exception e) {
|
|
public ResponseEntity<Object> handleOtherException(Exception e) {
|
|
log.error(e.getMessage(), e);
|
|
log.error(e.getMessage(), e);
|