NodeJS errors for cool kids
Ouch is a NodeJS implementation of PHP's Whoops library. It's not an exact port of Whoops, but implements similar functionality and uses same front end resources in some of its error handlers. It is an error handler base/framework for NodeJs. Out-of-the-box, it provides a pretty error interface that helps you debug your web projects, but at heart it's a simple yet powerful stacked error handling system.
Pretty page handler demo
The source is available for download from GitHub. Alternatively, you can install using Node Package Manager (npm):
npm install ouch
// With PrettyPageHandlerhttp;// With custom callbackvar ouchInstance =;ouchInstance;
For more options, have a look at the example files in examples to get a feel for how things work. Also take a look at the API Documentation and the list of available handlers below.
Ouch currently ships with the following built-in handlers, available in the
PrettyPageHandler- Shows a pretty error page when something goes pants-up
JsonResponseHandler- Process errors and returns information on them as a JSON string.
CallbackHandler- Wraps a callable as a handler. You do not need to use this handler explicitly, Ouch will automatically wrap any callable you pass to
- Add more handlers.
Ouch is open-sourced software licensed under the MIT license.