Merge remote-tracking branch 'origin/feat/dev_251201' into feat/dev_251201
# Conflicts: # src/main/java/com/kamco/cd/kamcoback/mapsheet/MapSheetMngFileCheckerApiController.java # src/main/resources/application-local.yml
This commit is contained in:
@@ -472,23 +472,38 @@ public class GlobalExceptionHandler {
|
||||
}
|
||||
|
||||
@ExceptionHandler(CustomApiException.class)
|
||||
public ResponseEntity<ApiResponseDto<String>> handleCustomApiException(
|
||||
public ApiResponseDto<String> handleCustomApiException(
|
||||
CustomApiException e, HttpServletRequest request) {
|
||||
log.warn("[CustomApiException] resource : {}", e.getMessage());
|
||||
|
||||
String codeName = e.getCodeName();
|
||||
HttpStatus status = e.getStatus();
|
||||
String message = e.getMessage() == null ? ApiResponseCode.getMessage(codeName) : e.getMessage();
|
||||
|
||||
ApiResponseCode apiCode = ApiResponseCode.getCode(codeName);
|
||||
// String message = e.getMessage() == null ? ApiResponseCode.getMessage(codeName) :
|
||||
// e.getMessage();
|
||||
//
|
||||
// ApiResponseCode apiCode = ApiResponseCode.getCode(codeName);
|
||||
//
|
||||
// ErrorLogEntity errorLog =
|
||||
// saveErrorLogData(
|
||||
// request, apiCode, status, ErrorLogDto.LogErrorLevel.WARNING, e.getStackTrace());
|
||||
//
|
||||
// ApiResponseDto<String> body =
|
||||
// ApiResponseDto.createException(apiCode, message, status, errorLog.getId());
|
||||
|
||||
ErrorLogEntity errorLog =
|
||||
saveErrorLogData(
|
||||
request, apiCode, status, ErrorLogDto.LogErrorLevel.WARNING, e.getStackTrace());
|
||||
request,
|
||||
ApiResponseCode.getCode(codeName),
|
||||
HttpStatus.valueOf(status.value()),
|
||||
ErrorLogDto.LogErrorLevel.WARNING,
|
||||
e.getStackTrace());
|
||||
|
||||
ApiResponseDto<String> body =
|
||||
ApiResponseDto.createException(apiCode, message, status, errorLog.getId());
|
||||
return ApiResponseDto.createException(
|
||||
ApiResponseCode.getCode(codeName),
|
||||
ApiResponseCode.getMessage(codeName),
|
||||
HttpStatus.valueOf(status.value()),
|
||||
errorLog.getId());
|
||||
|
||||
return new ResponseEntity<>(body, status);
|
||||
// return new ResponseEntity<>(body, status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,6 +62,8 @@ public class SecurityConfig {
|
||||
// ADMIN, REVIEWER 접근
|
||||
.requestMatchers("/api/test/review")
|
||||
.hasAnyRole("ADMIN", "REVIEWER")
|
||||
.requestMatchers("/error")
|
||||
.permitAll()
|
||||
.requestMatchers(HttpMethod.OPTIONS, "/**")
|
||||
.permitAll() // preflight 허용
|
||||
.requestMatchers(
|
||||
|
||||
Reference in New Issue
Block a user