Skip to content

Commit

Permalink
modify 400 bad request size
Browse files Browse the repository at this point in the history
  • Loading branch information
noemil12 committed Nov 28, 2023
1 parent a3d24b2 commit 1515f50
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ public void handle(JsonMappingException e) {
public Mono<ResponseEntity<Problem>> handleResponseEntityException(final PDNDGenericException exception){
log.warn(exception.toString());
final Problem problem = new Problem();
problem.setTitle(HttpStatus.FORBIDDEN.name());
problem.setDetail(HttpStatus.valueOf(HttpStatus.FORBIDDEN.value()).getReasonPhrase());
if (exception.getExceptionType() == ExceptionTypeEnum.SIGNALID_ALREADY_EXISTS) {
problem.setTitle(HttpStatus.BAD_REQUEST.name());
problem.setDetail(HttpStatus.valueOf(HttpStatus.BAD_REQUEST.value()).getReasonPhrase());
} else {
problem.setTitle(HttpStatus.FORBIDDEN.name());
problem.setDetail(HttpStatus.valueOf(HttpStatus.FORBIDDEN.value()).getReasonPhrase());
}
problem.setStatus(exception.getHttpStatus().value());

ProblemError problemError= new ProblemError();
Expand Down

0 comments on commit 1515f50

Please sign in to comment.