JSPM

@flitz/errors

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q44579F
  • License MIT

Pretty error handling for flitz.

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

npm supported flitz version last build PRs Welcome

@flitz/errors

Creates an error handler for flitz with pretty HTML output.

Install

Run

npm install --save @flitz/errors

from 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.):

screenshot #1

TypeScript

TypeScript is optionally supported. The module contains its own definition files.

Credits

The module makes use of:

License

MIT © Marcel Kloubert