Skip to content

Commit a7f0dcc

Browse files
committed
make name required on Transaction class, set default value if not provided
1 parent bb40f48 commit a7f0dcc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/tracing/src/transaction.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Span as SpanClass, SpanRecorder } from './span';
66

77
/** JSDoc */
88
export class Transaction extends SpanClass {
9-
public name?: string;
9+
public name: string;
1010

1111
/**
1212
* The reference to the current hub.
@@ -29,9 +29,7 @@ export class Transaction extends SpanClass {
2929
this._hub = hub as Hub;
3030
}
3131

32-
if (transactionContext.name) {
33-
this.name = transactionContext.name;
34-
}
32+
this.name = transactionContext.name ? transactionContext.name : '';
3533

3634
this._trimEnd = transactionContext.trimEnd;
3735
}

0 commit comments

Comments
 (0)