|
@@ -2,6 +2,7 @@ package com.qmth.boot.api.exception;
|
|
|
|
|
|
import com.qmth.boot.core.exception.ReentrantException;
|
|
|
import com.qmth.boot.core.exception.StatusException;
|
|
|
+import com.qmth.boot.core.exception.UnauthorizedException;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
@@ -26,6 +27,12 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
|
|
|
return new ResponseEntity<>(e.responseEntity(), new HttpHeaders(), e.getStatus());
|
|
|
}
|
|
|
|
|
|
+ @ExceptionHandler(UnauthorizedException.class)
|
|
|
+ public ResponseEntity<Object> handleUnauthorizedException(UnauthorizedException e) {
|
|
|
+ //log.error(e.getMessage(), e);
|
|
|
+ return handleApiException(DefaultExceptionEnum.AUTHORIZATION_ERROR.exception(e.getMessage()));
|
|
|
+ }
|
|
|
+
|
|
|
@ExceptionHandler(ReentrantException.class)
|
|
|
public ResponseEntity<Object> handleReentrantException(ReentrantException e) {
|
|
|
//log.error(e.getMessage(), e);
|