Developer builds open-source library to standardize Node.js error handling across projects
A developer has released Erris, a small dependency-free TypeScript library under the MIT license, designed to eliminate repetitive error-handling boilerplate in Node.js backends. The library addresses a common problem where errors from tools like Prisma, Zod, and Axios each have different shapes, forcing developers to rewrite the same translation logic across every project. Erris works by normalizing any thrown error into a single predictable contract using namespaced, immutable error codes, preventing collisions between errors defined by different teams or modules. An optional companion package, @erris/http, converts normalized errors into RFC 9457 Problem Details HTTP responses, removing the need for custom JSON error formats. The project is available on GitHub and draws inspiration from the Standard Schema initiative, which sought a shared contract for validation libraries.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in