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