Skip to content

Coerces error-like objects (with stack properties) into strings #866

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

Closed
benvinegar opened this issue Feb 24, 2017 · 4 comments
Closed

Coerces error-like objects (with stack properties) into strings #866

benvinegar opened this issue Feb 24, 2017 · 4 comments

Comments

@benvinegar
Copy link
Contributor

benvinegar commented Feb 24, 2017

Raven.js checks if objects passed to Raven.captureException are errors using our isError helper, which is pretty strict: it basically checks if the object in question "descends" from Error using an instanceof check.

But there are some error-like objects out there (e.g. Ember.js) that have .stack properties but do not pass the instanceof Error check. We should probably handle these too.

See: ember-cli-sentry/ember-cli-sentry#72

@benoror
Copy link

benoror commented Mar 20, 2017

Hi @benvinegar, any update regarding this? Or any chance to give a hint and/or point out where the change should be made? Regards!

@benoror
Copy link

benoror commented Mar 20, 2017

Maybe passing something like:

|| !!what.stack

Somwhere around here (src/utils.js#L14) or here (plugins/ember.js#L22)

(disclaimer: educated guess)

@benvinegar
Copy link
Contributor Author

There's no point in making this check looser if Sentry is just going to blow up on the object anyways. (e.g. if it's an array of errors).

I still don't have a reproduction case (per the other thread in ember-cli-sentry).

@kamilogorek
Copy link
Contributor

We already improved those checks quite a bit.

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

4 participants