Skip to content

Commit cc7de02

Browse files
committed
fix: Use better default message for ReportingObserver
1 parent 983e68d commit cc7de02

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- [browser] ref: Expose `ReportDialogOptions`
6+
- [browser] ref: Use better default message for ReportingObserver
67

78
## 4.0.4
89

packages/browser/src/integrations/reportingobserver.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,11 @@ export class ReportingObserver implements Integration {
114114

115115
if (report.type === ReportTypes.Crash) {
116116
const body = report.body as CrashReportBody;
117-
details = `${body.crashId} ${body.reason}`;
117+
// A fancy way to create a message out of crashId OR reason OR both OR fallback
118+
details = [body.crashId || '', body.reason || ''].join(' ').trim() || details;
118119
} else {
119120
const body = report.body as DeprecationReportBody | InterventionReportBody;
120-
details = body.message;
121+
details = body.message || details;
121122
}
122123
}
123124

0 commit comments

Comments
 (0)