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

Unhandled rejections [Fixes #307] #312

Merged
merged 2 commits into from
Jun 15, 2017
Merged

Unhandled rejections [Fixes #307] #312

merged 2 commits into from
Jun 15, 2017

Conversation

rokob
Copy link
Contributor

@rokob rokob commented Jun 14, 2017

Rejecting with a non-error reason results in reason.message or String(reason) being set as the message to log. This gets rids of structure that the reason object might have had, so include the reason again to be picked up in custom data. I am not sure I would call it an anti-pattern per se to use non-errors as reasons for rejecting promises, but it is highly non-standard.

@coryvirok
Copy link
Contributor

It is non-standard but it's best to include more information than less especially when JS is so fre-form that you can throw non-exceptions/errors.

@coryvirok
Copy link
Contributor

Tagging issue #307

@alexilyaev
Copy link

Much appreciated!

@rokob rokob merged commit f33c957 into master Jun 15, 2017
@alexilyaev
Copy link

Can we publish this to npm?

@rokob rokob deleted the unhandled-rejections branch October 31, 2017 23:13
mudetroit pushed a commit that referenced this pull request Mar 14, 2024
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.

3 participants