Skip to content

Commit 4e749f6

Browse files
fix/error naming convention
1 parent 1b85454 commit 4e749f6

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

packages/browser/src/client.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ export abstract class BrowserClient implements IBrowserClient {
7575
return null;
7676
}
7777

78-
const type = error?.name || "Error";
78+
const name = error?.name || "Error";
7979
const message = error?.message || "(No message)";
8080

8181
const stack = error?.stack || "";
8282

8383
const traces: Trace[] = stacktrace.parse(stack);
8484

8585
const err: BrowserIncidentType = {
86-
type,
86+
name,
8787
message,
8888
stack,
8989
traces,
@@ -127,7 +127,7 @@ export abstract class BrowserClient implements IBrowserClient {
127127
}
128128

129129
if (data?.event) {
130-
eventError.type = data.event.toString();
130+
eventError.name = data.event.toString();
131131
}
132132

133133
this.sendError(eventError);
@@ -139,7 +139,7 @@ export abstract class BrowserClient implements IBrowserClient {
139139
if ("reason" in data.event) {
140140
const reason = data.event.reason;
141141

142-
const type = "Unhandled rejection";
142+
const name = "Unhandled rejection";
143143
const message = reason.message;
144144

145145
let stack = "";
@@ -151,7 +151,7 @@ export abstract class BrowserClient implements IBrowserClient {
151151

152152
const traces: Trace[] = stacktrace.parse(stack);
153153
const err: BrowserIncidentType = {
154-
type,
154+
name,
155155
message,
156156
stack,
157157
traces,

packages/browser/src/types/transport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export type RequestOptions<T> = {
2222
};
2323

2424
export type BrowserIncidentType = {
25-
type?: string;
25+
name?: string;
2626
message?: string;
2727
stack?: string;
2828
details: object;

0 commit comments

Comments
 (0)