AdamVig / GoCoApi

API Server for the GoCoStudent app.
https://gocostudent.adamvig.com/api
GNU General Public License v3.0
0 stars 0 forks source link

Improve error reporting #16

Closed AdamVig closed 8 years ago

AdamVig commented 8 years ago

Error reporting was sorely lacking before these changes. Instead of using Restify's competent built-in HTTP error reporting abilities, the app relied on a custom formatter (final step in the response handler chain) and simple native throw new Error() statements, which could not carry any information about the type of error to throw.

Using Restify's error handling allows for throwing descriptive errors with HTTP status codes and useful debug messages, while still passing the user-friendly messages meant for direct display in an interface.

See #14.

AdamVig commented 8 years ago

Closes #16.