Skip to content

TypeScript types for exceptions #325

@ides15

Description

@ides15

Is your feature request related to a problem? Please describe.
I'd like to have better type safety on exceptions thrown by node-rfc. At the moment, I have to parse these exceptions by hand.

Describe the solution you'd like
Export the possible types for exceptions from node-rfc (This commit looks like what I want, don't think it has been published in a release yet).

  • Edit: I also noticed these lines, these are string literals (not a TypeScript string type); not sure if this is intentional but I would think the types should be:

      export interface INodeRfcError {
          name: "nodeRfcError";
    -     message: "string";
    +     message: string;
    -     rfmPath?: "string";
    +     rfmPath?: string;
      }
    

Describe alternatives you've considered
Building these types myself.

Additional context
n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions