File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -721,11 +721,10 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
721721 if ( DEBUG_BUILD ) {
722722 // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for
723723 // control flow, log just the message (no stack) as a log-level log.
724- const sentryError = reason as SentryError ;
725- if ( sentryError . logLevel === 'log' ) {
726- logger . log ( sentryError . message ) ;
724+ if ( reason instanceof SentryError && reason . logLevel === 'log' ) {
725+ logger . log ( reason . message ) ;
727726 } else {
728- logger . warn ( sentryError ) ;
727+ logger . warn ( reason ) ;
729728 }
730729 }
731730 return undefined ;
Original file line number Diff line number Diff line change @@ -2,9 +2,6 @@ import type { ConsoleLevel } from '../types-hoist';
22
33/** An error emitted by Sentry SDKs and related utilities. */
44export class SentryError extends Error {
5- /** Display name of this error instance. */
6- public name : string ;
7-
85 public logLevel : ConsoleLevel ;
96
107 public constructor (
@@ -13,11 +10,6 @@ export class SentryError extends Error {
1310 ) {
1411 super ( message ) ;
1512
16- this . name = new . target . prototype . constructor . name ;
17- // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line
18- // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes
19- // instances of `SentryError` fail `obj instanceof SentryError` checks.
20- Object . setPrototypeOf ( this , new . target . prototype ) ;
2113 this . logLevel = logLevel ;
2214 }
2315}
You can’t perform that action at this time.
0 commit comments