Skip to content

Commit

Permalink
Merge pull request #18 from rcsim/fix/arrumandoTestes
Browse files Browse the repository at this point in the history
fix: erro exception handler
  • Loading branch information
victorptoledo authored Mar 15, 2024
2 parents 3761229 + 0de72a7 commit a8d5145
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,17 @@ protected ResponseEntity<Object> badRequest(BadRequestException e, HttpServletRe
body.put("path", request.getRequestURI());
return new ResponseEntity<>(body, status);
}
@ExceptionHandler(RoomNotAvailableException.class)
protected ResponseEntity<Object> badRequest(RoomNotAvailableException e, HttpServletRequest request) {
HttpStatus status = HttpStatus.BAD_REQUEST;

Map<String, Object> body = new HashMap<>();
body.put("timestamp", Instant.now());
body.put("status", status.value());
body.put("error", e.getMessage());
body.put("path", request.getRequestURI());
return new ResponseEntity<>(body, status);
}


}

0 comments on commit a8d5145

Please sign in to comment.