hmis-tools / hmis-api-server

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

Errors, Validation and Exceptions #37

Open slifty opened 8 years ago

slifty commented 8 years ago

When we ultimately implement field validation we will need to think about the proper architecture for error handling and exceptions. Right now exceptions are caught before getting to the user, which means that we have no effective way of communicating validation (or authentication) issues without just throwing an error which is BAD. We have authentication-with-500-erroring-as-a-feature for now knowing how bad it is, but we absolutely must improve this (soon).

We need to design and implement the proper structure for error returns. Ideally one that will support the return of multiple errors (for instance if there are multiple validation issues it would be good to communicate that all at once).

cecilia-donnelly commented 8 years ago

Merging in PR #46 didn't fully fix this, since we have some other exceptions left to handle. But the structure is now here.