Skip to content

Add comment to Raven.wrap so people stop blaming Raven.js #847

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

Merged
merged 1 commit into from
Feb 3, 2017

Conversation

benvinegar
Copy link
Contributor

@benvinegar benvinegar commented Feb 3, 2017

The idea is that this comment will appear in stack frames to help users understand what is happening, whereas right now they are just seeing this (screenshot below), which leads them to believe there is a bug in the library when it's really just normal operation:

Before:

image

After:

image

Making this change cause I'm getting tired of explaining it to people.

cc @getsentry/javascript

@MaxBittker
Copy link
Contributor

🙌

Copy link
Contributor

@MaxBittker MaxBittker left a comment

Choose a reason for hiding this comment

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

maybe mention that their error will be earlier in the stack trace?

@benvinegar
Copy link
Contributor Author

benvinegar commented Feb 3, 2017

maybe mention that their error will be earlier in the stack trace?

Not always. In this example, Raven is the only frame.

This "freed script" error means that a function existed (say, accessible via an iframe), then was removed from the page when the iframe was removed. The function is still attempted to be executed asynchronously via something like setTimeout(freedFn, 10000) – and because setTimeout is async, Raven is the only frame (wraps freedFn in a try/catch).

@benvinegar benvinegar merged commit 28a6732 into master Feb 3, 2017
@benvinegar benvinegar deleted the tired-of-this branch February 3, 2017 23:40
@benvinegar
Copy link
Contributor Author

One last note: this comment was intentionally made to be 4 lines long because Sentry records 5 frames of before/after context by default. Doing so results in the first line being try {, which looks nice.

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.

2 participants