File tree 2 files changed +3
-12
lines changed
2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -903,11 +903,10 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
903
903
if ( DEBUG_BUILD ) {
904
904
// If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for
905
905
// control flow, log just the message (no stack) as a log-level log.
906
- const sentryError = reason as SentryError ;
907
- if ( sentryError . logLevel === 'log' ) {
908
- logger . log ( sentryError . message ) ;
906
+ if ( reason instanceof SentryError && reason . logLevel === 'log' ) {
907
+ logger . log ( reason . message ) ;
909
908
} else {
910
- logger . warn ( sentryError ) ;
909
+ logger . warn ( reason ) ;
911
910
}
912
911
}
913
912
return undefined ;
Original file line number Diff line number Diff line change @@ -2,9 +2,6 @@ import type { ConsoleLevel } from '../types-hoist';
2
2
3
3
/** An error emitted by Sentry SDKs and related utilities. */
4
4
export class SentryError extends Error {
5
- /** Display name of this error instance. */
6
- public name : string ;
7
-
8
5
public logLevel : ConsoleLevel ;
9
6
10
7
public constructor (
@@ -13,11 +10,6 @@ export class SentryError extends Error {
13
10
) {
14
11
super ( message ) ;
15
12
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 ) ;
21
13
this . logLevel = logLevel ;
22
14
}
23
15
}
You can’t perform that action at this time.
0 commit comments