uh-oh
uh-oh is an error handler for Express with a stylistic and useful interface for viewing application error traces.
Features
- Stack Traces – Get a list of errors and where they happend.
- Source Code Preview – Get a quick summary of where errors occurred with indicators.
- Context Overview – See context of your application and the request body.
- Open In Editor – Quickly open source files from the browser with a click.
... and more to come.
Install
Simply install it using npm
npm install --save uh-oh
or using Yarn
yarn add uh-oh
Usage
// Register it after routes and middlewares, that you// want uh-oh to handle.app
Note: It also registers a middleware to allow opening file URLs in your editor.
API
uhOh(app: express.Application[, options: Object]) -> Function
Returns a middleware function, which catches errors passed by other middleware.
Options
stackTraceOptions: Object
Options are passed in to parsetrace.
editorOptions: Object
Additional options are passed in to express-open-in-editor.
Future Plans
Uh-oh is still in the works, and a few plans to improve it are under way:
- Support sourcemaps for compiled/minified source files.
- Syntax highlighting for source view.
Contributing
You're welcome to create an issue or submit a pull request if you either have a great addition or just found a bug.