-
Notifications
You must be signed in to change notification settings - Fork 46
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] Allow using a custom error fingerprint in simple error logs #796
[FIX] Allow using a custom error fingerprint in simple error logs #796
Conversation
9065fc7
to
960814f
Compare
return logEvent; | ||
}); | ||
|
||
console.error('test-error'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}; | ||
|
||
export const formatRawLogToNativeEvent = ( | ||
rawLog: RawLog | RawLogWithError | ||
): NativeLog | NativeLogWithError => { | ||
if ((rawLog as RawLogWithError).fingerprint) { | ||
(rawLog.context as any)[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return (this.context as any)[DdAttributes.errorFingerprint] as string; | ||
} | ||
public set fingerprint(value: string | undefined) { | ||
(this.context as any)[DdAttributes.errorFingerprint] = value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attributes?: object | undefined; | ||
|
||
public get fingerprint(): string | undefined { | ||
return (this.context as any)[DdAttributes.errorFingerprint] as string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this PR do?
Allows passing a custom error fingerprint to error logs that consist of only a message and an optional context.
Motivation
It is currently possible to use a custom error fingerprint for logs with error, but not for simple logs that only have a message and an optional context.
Review checklist (to be filled by reviewers)