sensorweb-server-helgoland icon indicating copy to clipboard operation
sensorweb-server-helgoland copied to clipboard

Wrong error code when sending request with bad timespan filter

Open EHJ-52n opened this issue 4 years ago • 2 comments

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."
}

EHJ-52n avatar Mar 04 '20 19:03 EHJ-52n