Skip to content

Commit

Permalink
feat: error test
Browse files Browse the repository at this point in the history
  • Loading branch information
CChuYong committed Dec 15, 2024
1 parent c3c4627 commit b1cb8a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private Mono<ResponseEntity<String>> 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,9 @@ Mono<SumoneInviteCodeResponse> getInviteCode(
.findById(userId)
.map(SumoneInviteCodeResponse::fromEntity);
}

@PostMapping("/error")
Mono<String> error() {
return Mono.error(new RuntimeException("error"));
}
}

0 comments on commit b1cb8a8

Please sign in to comment.