Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
9f2292ea
Commit
9f2292ea
authored
Jul 25, 2019
by
Piotr Gawron
Browse files
when type of the argument is wrong return 400
parent
1ea69afe
Changes
1
Hide whitespace changes
Inline
Side-by-side
rest-api/src/main/java/lcsb/mapviewer/api/BaseController.java
View file @
9f2292ea
...
...
@@ -14,6 +14,7 @@ import org.springframework.web.HttpMediaTypeNotSupportedException;
import
org.springframework.web.bind.MissingServletRequestParameterException
;
import
org.springframework.web.bind.ServletRequestBindingException
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.method.annotation.MethodArgumentTypeMismatchException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
...
...
@@ -41,7 +42,8 @@ public abstract class BaseController {
}
else
if
(
e
instanceof
QueryException
||
e
instanceof
HttpMessageNotReadableException
||
e
instanceof
MissingServletRequestParameterException
||
e
instanceof
HttpMediaTypeNotSupportedException
)
{
||
e
instanceof
HttpMediaTypeNotSupportedException
||
e
instanceof
MethodArgumentTypeMismatchException
)
{
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
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment