hmis-tools / hmis-api-server

Version 2 of OpenHMIS
Mozilla Public License 2.0
15 stars 11 forks source link

Server returns 500 errors for cases that should be handled more specifically. #62

Open kfogel opened 8 years ago

kfogel commented 8 years ago

There are various cases where the server will return code 500 (Internal Server Error) to the client because something threw a generic exception or failed in some other way, when what we really want is to handle that case with a proper exception. I don't have an example of such a case right now, but @slifty can probably think of some.

Note this is not related to issue #44, or at least they're not about the same thing. It might, however, be related to issue #19.

kfogel commented 8 years ago

Example of this kind of 500 error: If you don't give a Java-valid date format for any date field, we'll just get a 500 error.

But not all of these cases are about validation. Basically, we should never be returning a 500 error; we should always return something better than that.