Package Exports
- @flitz/errors
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@flitz/errors) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@flitz/errors
Creates an error handler for flitz with pretty HTML output.
Install
Run
npm install --save @flitz/errorsfrom the folder, where your package.json is stored.
Usage
const flitz = require('flitz');
const errors = require('@flitz/errors');
const run = async () => {
const app = flitz();
app.get('/', async (req, res) => {
throw new ReferenceError('Oops! Something went wrong!');
});
app.setErrorHandler(errors());
await app.listen(3000);
};
run();Or the TypeScript way:
import flitz from 'flitz';
import { errors } from '@flitz/errors';
const run = async () => {
const app = flitz();
app.get('/', async (req, res) => {
throw new ReferenceError('Oops! Something went wrong!');
});
app.setErrorHandler(errors());
await app.listen(3000);
};
run();A possible result could be (the Show all frames has to checked btw.):

TypeScript
TypeScript is optionally supported. The module contains its own definition files.
Credits
The module makes use of:
License
MIT © Marcel Kloubert