sensorweb-server-helgoland
sensorweb-server-helgoland copied to clipboard
Wrong error code when sending request with bad timespan filter
I received the wrong response code, when sending the following GET request ...api/timeseries/TBD/observations?timespan=2019-11-31/2019-12-31
:
{
"statusCode": 500,
"reason": "Internal Server Error",
"userMessage": "Unexpected Exception occured.",
"developerMessage":
"Cannot parse '2019-11-31':
Value 31 for dayOfMonth must be in the range [1,30]"
}
The response should look like this:
{
"statusCode": 400,
"reason": "Bad Request",
"userMessage":
"timespan filter not correct: Cannot parse '2019-11-31':
Value 31 for dayOfMonth must be in the range [1,30]",
"developerMessage": "any additional detail, that might help."
}