Skip to content

More error types, an additional ErrorCode, and TypeScript declarations #1

@kael-shipman

Description

@kael-shipman

Hi!

I find myself always writing an extension to this library in situ to add the two first features mentioned. I'm wondering if you would accept a PR that adds these. Here's what I would do:

  1. Add a base HttpError class
  2. Make existing error classes extend from that
  3. Add an optional code?: string parameter that would allow front-end consumers to differentiate errors better
  4. Add a few more error types (409, 500, 501, 502, 503, 504)
  5. In-house typescript definitions (i.e., change the repo to a typescript repo)

If not, I understand, I know it's a bunch of changes. I just didn't want to make a duplicate package on npm. Lemme know what you think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions