diff --git a/photo-service/src/main/java/kr/mafoo/photo/config/WebExceptionHandler.java b/photo-service/src/main/java/kr/mafoo/photo/config/WebExceptionHandler.java index 3b27e99..1a79d9d 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/config/WebExceptionHandler.java +++ b/photo-service/src/main/java/kr/mafoo/photo/config/WebExceptionHandler.java @@ -113,7 +113,7 @@ private Mono> handleExceptionInternal(ServerWebExchange e if (status == HttpStatus.INTERNAL_SERVER_ERROR) { return slackService.sendErrorNotification( requestMemberId, method, fullPath, requestBody, originIp, userAgent, exception.getMessage() - ).then(Mono.just(new ResponseEntity<>("Internal Server Error", status))); + ).then(Mono.error(exception)); } return Mono.just(new ResponseEntity<>(status.getReasonPhrase(), status)); diff --git a/photo-service/src/main/java/kr/mafoo/photo/controller/SumoneController.java b/photo-service/src/main/java/kr/mafoo/photo/controller/SumoneController.java index 21db1d6..72d33f0 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/controller/SumoneController.java +++ b/photo-service/src/main/java/kr/mafoo/photo/controller/SumoneController.java @@ -162,4 +162,9 @@ Mono getInviteCode( .findById(userId) .map(SumoneInviteCodeResponse::fromEntity); } + + @PostMapping("/error") + Mono error() { + return Mono.error(new RuntimeException("error")); + } }