|
1 | 1 | package org.runnect.server.common.advice; |
2 | 2 |
|
3 | | -import lombok.RequiredArgsConstructor; |
4 | | - |
| 3 | +import io.sentry.Sentry; |
| 4 | +import java.io.IOException; |
| 5 | +import java.util.Objects; |
5 | 6 | import javax.servlet.http.HttpServletRequest; |
6 | 7 | import javax.validation.ConstraintViolationException; |
| 8 | +import lombok.RequiredArgsConstructor; |
| 9 | +import org.runnect.server.common.constant.ErrorStatus; |
| 10 | +import org.runnect.server.common.dto.ApiResponseDto; |
| 11 | +import org.runnect.server.common.exception.BasicException; |
| 12 | +import org.runnect.server.config.slack.SlackApi; |
7 | 13 | import org.springframework.http.HttpStatus; |
8 | 14 | import org.springframework.http.ResponseEntity; |
9 | 15 | import org.springframework.stereotype.Component; |
|
14 | 20 | import org.springframework.web.bind.annotation.ExceptionHandler; |
15 | 21 | import org.springframework.web.bind.annotation.ResponseStatus; |
16 | 22 | import org.springframework.web.bind.annotation.RestControllerAdvice; |
17 | | -import org.runnect.server.common.dto.ApiResponseDto; |
18 | | -import org.runnect.server.common.constant.ErrorStatus; |
19 | | -import org.runnect.server.common.exception.BasicException; |
20 | | -import org.runnect.server.config.slack.SlackApi; |
21 | | - |
22 | | -import java.io.IOException; |
23 | | -import java.util.Objects; |
24 | 23 |
|
25 | 24 | @RestControllerAdvice |
26 | 25 | @Component |
@@ -74,6 +73,7 @@ protected ApiResponseDto handleMissingRequestParameterException(final MissingSer |
74 | 73 | @ExceptionHandler(Exception.class) |
75 | 74 | protected ApiResponseDto<Object> handleException(final Exception error, final HttpServletRequest request) throws IOException { |
76 | 75 | slackApi.sendAlert(error, request); |
| 76 | + Sentry.captureException(error); |
77 | 77 | return ApiResponseDto.error(ErrorStatus.INTERNAL_SERVER_ERROR); |
78 | 78 | } |
79 | 79 |
|
|
0 commit comments