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

ClientResponse exception key should be defined as Errors type instead of Error #75

Open
armanatz opened this issue May 7, 2022 · 0 comments

Comments

@armanatz
Copy link

armanatz commented May 7, 2022

Referring to this line, shouldn't the defined type be Errors to conform with the interface found here? Right now, Error refers to the standard JS error class instead.

Also, I am not sure if importing ClientResponse directly in my code is the right thing to do. Shouldn't there be a named export inside FusionAuthClient.ts that corresponds with the schema of ClientResponse?

The reason I need this is for defining error handling inside catch blocks for errors originating from the FusionAuth library.

The other alternative is to handle catch errors with the any type but I don't like that and I don't want that to be a standard thing in our app.

Sorry if I am completely wrong with my approach as I am just getting acquainted with TypeScript. In which case, would you let me know how I can define FusionAuth errors correctly in my catch blocks?

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