Skip to content
Snippets Groups Projects
Commit 8dec92d0 authored by Lukas Karsch's avatar Lukas Karsch
Browse files

#32 reformat file

parent 92c3e471
No related branches found
No related tags found
1 merge request!20Resolve "Error handling für controller"
......@@ -16,18 +16,13 @@ public class RestErrorHandler extends ResponseEntityExceptionHandler {
private final static Logger log = LoggerFactory.getLogger(RestErrorHandler.class);
@ExceptionHandler(GrowBrosException.class)
protected ResponseEntity<String> handleGrowBrosException(
GrowBrosException e
) {
protected ResponseEntity<String> handleGrowBrosException(GrowBrosException e) {
log.error("Handling exception '{}' : {} (Status code {})", e.getClass(), e.getMessage(), e.getStatusCode());
return ResponseEntity.status(e.getStatusCode()).body(e.getMessage());
}
@ExceptionHandler
protected ResponseEntity<Object> handleInternalServerError(
RuntimeException e,
WebRequest req
) {
protected ResponseEntity<Object> handleInternalServerError(RuntimeException e, WebRequest req) {
log.error("Handling internal server error: {}", e.getClass());
log.error("Stacktrace:", e);
return handleExceptionInternal(e, "Internal server error", new HttpHeaders(), HttpStatus.INTERNAL_SERVER_ERROR, req);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment