Commit 146eca6c authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

return 400 instead of 500

parent 9be3d2dc
......@@ -10,6 +10,7 @@ import org.apache.logging.log4j.Logger;
import org.springframework.http.*;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.web.bind.MissingServletRequestParameterException;
import org.springframework.web.bind.ServletRequestBindingException;
import org.springframework.web.bind.annotation.ExceptionHandler;
......@@ -36,7 +37,7 @@ public abstract class BaseController {
} else if (e instanceof OperationNotAllowedException) {
return createErrorResponse("Operation not allowed.", e.getMessage(), new HttpHeaders(),
HttpStatus.METHOD_NOT_ALLOWED);
} else if (e instanceof QueryException || e instanceof HttpMessageNotReadableException) {
} else if (e instanceof QueryException || e instanceof HttpMessageNotReadableException || e instanceof MissingServletRequestParameterException) {
logger.error(e, e);
return createErrorResponse("Query server error.", e.getMessage(), new HttpHeaders(), HttpStatus.BAD_REQUEST);
} else if (e instanceof ServletRequestBindingException && e.getMessage().contains(Configuration.AUTH_TOKEN)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment