universal-api-errors

Roadmap

What's shipped, and what's planned.

v1.0 — shipped

  • Core (parseError, UniversalError, classification, retry, validation parsing, logging)
  • Axios adapter
  • fetch adapter
  • Strict TypeScript throughout

Published as @harshilrajput/universal-api-errors-core, -axios, and -fetch.

React Query — shipped, ahead of schedule

Originally scoped for v1.5, but pulled forward: React Query is how most React apps actually make API calls today, and the library had nothing yet for that layer. Published as @harshilrajput/universal-api-errors-react-query — see the React Query guide. It's not a parser (React Query doesn't invent its own error format), so this is useApiError() for pulling a normalized error out of a query/mutation result, and createRetry() for making React Query's retry option respect real error classification.

Nothing else on this page is available yet — this is a roadmap, not a feature list.

v1.5 — planned

  • React utilities beyond React Query — likely an ErrorBoundary wrapper.
  • Express middlewareerrorMiddleware(), built on a parseNodeError/parseExpressError for non-UniversalError throws.
  • NestJS exception filter — respecting Nest's own HttpException status codes rather than reclassifying them.
  • Toast integration — most likely one generic formatToast(error) helper plus docs recipes per toast library, rather than a separate adapter package per library.
  • Internationalization — scoped to translating the library's own generated strings (suggestion, debug/log labels), not the passthrough message field from the origin API.
  • GraphQL / SWR adapters are also in the original scope, but may end up as docs recipes instead of dedicated packages — both just pass through whatever the underlying fetch/Axios error was, and (unlike React Query) don't have an equivalent hook-level ergonomic gap to fill.

v2.0 — planned

  • Plugin system — a registry for custom parsers/classifiers and a use()/configure() entry point in core.
  • CLI — not yet concretely scoped.
  • Error reporting integrations (Sentry/Bugsnag) — attaching status/code/type/source as structured context.
  • Analytics hooks — a global onError(handler).
  • AI-assisted suggestions — under consideration, but in tension with this project's own "zero unnecessary dependencies" principle, since it would mean a network call and an API key inside an error-parsing library. If it happens, it'll be an opt-in plugin, not core.
  • DevTools — realistically its own product (browser extension / dev overlay), not a package increment.

Something missing?

Open an issue or a discussion on GitHub.

On this page