meveo-org / meveo

meveo core
GNU Affero General Public License v3.0
10 stars 15 forks source link

Return a valid API error when endpoint errors are encountered #698

Closed tonysviews closed 1 year ago

tonysviews commented 1 year ago

Describe the bug When any invalid format or other types of unhandled errors are encountered when an endpoint is called, it should return an error in a more friendly format instead of returning the HTML error page.

To Reproduce Steps to reproduce the behavior:

  1. Send a POST request with invalid json in the body of the request.
  2. The server returns the 500 error page of the meveo GUI

Expected behavior A 500 error is returned but the body should contain the error in json format, not HTML

Screenshots image

image

Additional context Note that this may also occur for other similar errors where the endpoint servlet should return a valid error in json instead of the meveo GUI error 500 HTML page.