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

Improve error message extraction #2484

Open
tnaum-ms opened this issue Dec 3, 2024 · 0 comments
Open

Improve error message extraction #2484

tnaum-ms opened this issue Dec 3, 2024 · 0 comments

Comments

@tnaum-ms
Copy link
Collaborator

tnaum-ms commented Dec 3, 2024

Review my code and apply a helpful tip from @bk201- from one of his recent PR-reviews:

In JS you have never be sure that error is instance of Error. It might be string, number, object, any type. I prefer use the following code taking into consideration that TS is type paranoid
const message = error instanceof Error ? error.message : String(error)

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

No branches or pull requests

1 participant