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

fix: Create error object in case we cant detect it #240

Merged
merged 5 commits into from
Jul 8, 2020
Merged

Conversation

HazAT
Copy link
Member

@HazAT HazAT commented Jul 7, 2020

This fixes a weird bug where we capture an exception which isn't detected as an error and therefore be captured as Non-Error exception captured with keys: message, name, stack

@HazAT HazAT requested a review from jan-auer July 7, 2020 09:44
@HazAT HazAT self-assigned this Jul 7, 2020
Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

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

I'm wondering if this is rather a problem of isError?

@@ -37,8 +38,16 @@ export class OnUncaughtException implements Integration {
level: Severity.Fatal,
}));

let theError = error;
if (!isError(error) && error.message && error.stack && error.name) {
Copy link
Member

Choose a reason for hiding this comment

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

Note that this is falsy if any of the attributes is empty. Do you rather mean to check for undefined?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I made it to only check for stack which makes it less strict.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good!

@HazAT HazAT merged commit 7f2b2cb into master Jul 8, 2020
@HazAT HazAT deleted the fix/error-object branch July 8, 2020 15:53
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.

None yet

2 participants