Skip to content

Commit

Permalink
[CHORE] 에러 핸들링 주석
Browse files Browse the repository at this point in the history
  • Loading branch information
jun02160 committed Jul 21, 2023
1 parent cd35b27 commit fd48c7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package sopt.org.umbbaServer.global.common.advice;

import io.jsonwebtoken.lang.UnknownClassException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.dao.IncorrectResultSizeDataAccessException;
import org.springframework.dao.InvalidDataAccessApiUsageException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.orm.jpa.JpaSystemException;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.FieldError;
Expand All @@ -20,7 +15,6 @@
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
import org.springframework.web.util.NestedServletException;
import sopt.org.umbbaServer.global.common.dto.ApiResponse;
import sopt.org.umbbaServer.global.exception.CustomException;
import sopt.org.umbbaServer.global.exception.ErrorType;
Expand All @@ -31,7 +25,6 @@
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.NoSuchElementException;

@Slf4j
@RestControllerAdvice
Expand Down Expand Up @@ -109,7 +102,7 @@ protected ApiResponse<Exception> handleException(final Exception e, final HttpSe
return ApiResponse.error(ErrorType.INTERNAL_SERVER_ERROR, e);
}

@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
/*@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ExceptionHandler(IllegalArgumentException.class)
public ApiResponse<Exception> handlerIllegalArgumentException(final IllegalArgumentException e) {
return ApiResponse.error(ErrorType.INTERNAL_SERVER_ERROR, e);
Expand All @@ -134,11 +127,11 @@ protected ApiResponse<Exception> handlerIndexOutOfBoundsException(final IndexOut
return ApiResponse.error(ErrorType.INDEX_OUT_OF_BOUNDS, e);
}
/*@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
*//*@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ExceptionHandler(UnknownClassException.class)
protected ApiResponse<Exception> handlerUnknownClassException(final UnknownClassException e) {
return ApiResponse.error(ErrorType.JWT_SERIALIZE, e);
}*/
}*//*
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ExceptionHandler(NoSuchElementException.class)
Expand Down Expand Up @@ -180,7 +173,7 @@ public ApiResponse<Exception> handlerJpaSystemException(final JpaSystemException
@ExceptionHandler(NullPointerException.class)
public ApiResponse<Exception> handlerNullPointerException(final NullPointerException e) {
return ApiResponse.error(ErrorType.NULL_POINTER_ERROR, e);
}
}*/



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.bind.annotation.*;
import sopt.org.umbbaServer.global.common.dto.ApiResponse;
import sopt.org.umbbaServer.global.config.jwt.JwtProvider;
import sopt.org.umbbaServer.global.exception.SuccessType;
import sopt.org.umbbaServer.global.util.fcm.FCMScheduler;
import sopt.org.umbbaServer.global.util.fcm.controller.dto.FCMPushRequestDto;
import sopt.org.umbbaServer.global.util.fcm.FCMService;
import sopt.org.umbbaServer.global.util.fcm.controller.dto.FCMPushRequestDto;

import java.io.IOException;
import java.security.Principal;
Expand Down

0 comments on commit fd48c7a

Please sign in to comment.