
Unify Fastify
A Fastify plugin wrapping unify-errors to handle REST errors. Old Owner: @flexper
Install
npm i unify-fastify
yarn add unify-fastify
pnpm add unify-fastify
Use
import fastify from 'fastify'
import unifyFastifyPlugin from 'unify-fastify';
import { BadRequest } from 'unify-errors';
const server = fastify()
server.register(unifyFastifyPlugin, { })
server.get('/bad-request', async () => {
throw new BadRequest({ example: 'A bad request error'})
})
Plugin options
disableDetails | false | Disable error details like stack |
disableLog | false | Disable logging on error |
Tests
To execute jest tests (all errors, type integrity test)
pnpm test
Maintain
This package use TSdx. Please check documentation to update this package.