Skip to content

Commit

Permalink
fix(types): Make name required on transaction class (#2949)
Browse files Browse the repository at this point in the history
This allows the class to implement the interface, where `name` has always been required.
  • Loading branch information
lobsterkatie authored Oct 2, 2020
1 parent e39c754 commit bead28c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/tracing/src/transaction.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { getCurrentHub, Hub } from '@sentry/hub';
import { TransactionContext } from '@sentry/types';
import { Transaction as TransactionInterface, TransactionContext } from '@sentry/types';
import { isInstanceOf, logger } from '@sentry/utils';

import { Span as SpanClass, SpanRecorder } from './span';

/** JSDoc */
export class Transaction extends SpanClass {
public name?: string;
export class Transaction extends SpanClass implements TransactionInterface {
public name: string;

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

if (transactionContext.name) {
this.name = transactionContext.name;
}
this.name = transactionContext.name ? transactionContext.name : '';

this._trimEnd = transactionContext.trimEnd;
}
Expand Down

0 comments on commit bead28c

Please sign in to comment.