Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript types for exceptions #325

Open
ides15 opened this issue Apr 8, 2024 · 0 comments
Open

TypeScript types for exceptions #325

ides15 opened this issue Apr 8, 2024 · 0 comments

Comments

@ides15
Copy link

ides15 commented Apr 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant