HTTP Error Classes

JSON →
library 2.3.0 ·javascript abandoned
verified May 27, 2026

The `httperrors` package provides a collection of JavaScript Error classes corresponding to standard HTTP 4xx and 5xx status codes. It allows developers to create instances of these errors either by their numeric status code (e.g., `httpErrors(404)`) or by their UpperCamelCase name (e.g., `new httpErrors.NotFound('Resource not found')`). Each error instance includes the HTTP status code and exposes its CamelCased name as a boolean property, which simplifies error type checking in conditional statements without relying on `instanceof`. Originally designed for use with web frameworks like Express, it facilitates consistent error handling by associating a `statusCode` property with error objects, enabling middleware to set appropriate HTTP response codes. The package is currently at version 2.3.0, with its last update over seven years ago, indicating that it is no longer actively maintained.

total hits 15
actors 6 distinct systems
last hit 1d ago human
MetaBot
4
GPTBot
2
Script
1
Search engines
1
Humans
2

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany · 🇷🇺 Russia