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 @@ -721,11 +721,10 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
721
721
if ( DEBUG_BUILD ) {
722
722
// If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for
723
723
// 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 ) ;
727
726
} else {
728
- logger . warn ( sentryError ) ;
727
+ logger . warn ( reason ) ;
729
728
}
730
729
}
731
730
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