Skip to content

About

A small, opinionated Fastify plugin and core library for typed HTTP exceptions.

Topics

Resources

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

77 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fastify HTTP Exceptions

NPM Package NPM Downloads Tests Coverage Discord

fastify-http-exceptions is a small, opinionated Fastify plugin and core library for typed HTTP exceptions. It lets you throw HTTP exceptions with structured error payloads in your route handlers and have them automatically converted into proper Fastify responses. The core utilities are framework-agnostic; the Fastify plugin was created out of real-world need to simplify error handling in larger APIs.

See packages/fastify-http-exceptions/README.md for full documentation.


Monorepo Layout

This repository is a small monorepo:

  • packages/fastify-http-exceptions: core library and Fastify plugin.
  • demos/basic-example: a demo Fastify app that uses the plugin.

You generally only need the published fastify-http-exceptions package, but the demo and tests live here as reference.


Development

pnpm install
pnpm dev
pnpm tsc
pnpm build
pnpm lint # oxlint
pnpm lint:fix
pnpm format # oxfmt
pnpm test # vitest

To run the demo app: pnpm dev (all dev targets in parallel) or pnpm start (basic-example). See CONTRIBUTING.md for the issue/PR workflow and RELEASING.md for release setup. Releases are published by manually running the Release workflow on main.

Author

Ben Houston, Sponsored by Land of Assets

About

A small, opinionated Fastify plugin and core library for typed HTTP exceptions.

Topics

Resources

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages