perf(exception): añadido exception handler para excepción del límite de peticiones a la IA

parent 83573807
......@@ -27,12 +27,13 @@ public class ExceptionController {
}
@ExceptionHandler(PythonApiException.class)
@ResponseStatus(HttpStatus.TOO_MANY_REQUESTS)
public ResponseEntity<ErrorMessage> handle(PythonApiException ex) {
return ResponseEntity
.status(ex.getStatus()).
body(new ErrorMessage(
LocalDateTime.now(),
ex.getStatus().value(),
HttpStatus.TOO_MANY_REQUESTS.value(),
ex.getMessage()
));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment