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

Check thrown type, print String(...) if not instance of error #939

Merged
merged 2 commits into from
Oct 8, 2018

Conversation

kevinkassimo
Copy link
Contributor

@kevinkassimo kevinkassimo commented Oct 8, 2018

Trying to close #935

Only print stack if the thrown is of instance of Error. Otherwise, print Thrown: ${String(thrown)}.
For example,

throw {};

now prints

Thrown: [object Object]

@kevinkassimo kevinkassimo changed the title Check thrown type, print toString() if not instance of error [WIP] Check thrown type, print toString() if not instance of error Oct 8, 2018
@kevinkassimo kevinkassimo changed the title [WIP] Check thrown type, print toString() if not instance of error Check thrown type, print toString() if not instance of error Oct 8, 2018
@kevinkassimo kevinkassimo changed the title Check thrown type, print toString() if not instance of error Check thrown type, print String(...) if not instance of error Oct 8, 2018
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks Kevin

(My only concern is adding new "check_output_tests" as they take longer to run. But in this case it's probably good to have an integration tests. Please try to use unit_tests instead of "check_output_tests" where possible.)

@ry ry merged commit 2b8cee9 into denoland:master Oct 8, 2018
@kevinkassimo kevinkassimo deleted the error/check-type branch December 27, 2019 07:52
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

Successfully merging this pull request may close these issues.

Error handler always reads error.stack, regardless of type (and blows up)
2 participants