Skip to content

Commit

Permalink
fix(node): More relevant warning message when tracing extensions are …
Browse files Browse the repository at this point in the history
…missing (#8820)

Closes #8624
  • Loading branch information
timfish committed Aug 17, 2023
1 parent 65df869 commit c20e0fb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/core/src/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,19 @@ export class Hub implements HubInterface {
const result = this._callExtensionMethod<Transaction>('startTransaction', context, customSamplingContext);

if (__DEBUG_BUILD__ && !result) {
// eslint-disable-next-line no-console
console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
const client = this.getClient();
if (!client) {
// eslint-disable-next-line no-console
console.warn(
"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'",
);
} else {
// eslint-disable-next-line no-console
console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
Sentry.addTracingExtensions();
Sentry.init({...});
`);
}
}

return result;
Expand Down

0 comments on commit c20e0fb

Please sign in to comment.