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

"Non-Error exception captured with keys: [...]" due to invalid error instanceof check #6822

Closed
3 tasks done
theofidry opened this issue Jan 17, 2023 · 4 comments · Fixed by #9026
Closed
3 tasks done

Comments

@theofidry
Copy link
Contributor

theofidry commented Jan 17, 2023

This issue is a follow up of #6332. It has been close since at that time I thought this was an Angular package only issue, but it looks like the is also upstream.

From what I can see, this is caused by https://github.com/getsentry/sentry-javascript/blob/master/packages/browser/src/eventbuilder.ts#L228-L230.

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which package are you using?

@sentry/angular

SDK Version

7.4.30

Framework Version

Angular 13.3 & Ionic 5

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

throw {
  name: 'ErrorLikeObject',
  message: 'ErrorLikeObject message',
};

Expected Result

A Sentry record showing something along the lines of:

ErrorLikeObject
ErrorLikeObject message

Actual Result

The current Sentry record showing something along the lines of:

captureException
Non-Error exception captured with keys: message, name
@AbhiPrasad
Copy link
Member

Hey @theofidry thanks for writing in again! We can probably make a similar change to the core logic here to capture this as a proper error. Backlogging, but PRs are welcome!

@AbhiPrasad
Copy link
Member

This has been fixed in browser as of v7.57.0 of the JavaScript SDKs, but it is still a problem in Node.

@AbhiPrasad
Copy link
Member

Improvements released with with https://github.com/getsentry/sentry-javascript/releases/tag/7.70.0 of the Node SDK. Please let us know if you have any feedback!

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

Successfully merging a pull request may close this issue.

4 participants