Skip to content

Commit c6d717e

Browse files
authored
fix log not being printed issue (#1015)
1 parent d68c37a commit c6d717e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/error/optimizly_error.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ export class OptimizelyError extends Error {
2525
this.name = 'OptimizelyError';
2626
this.baseMessage = baseMessage;
2727
this.params = params;
28+
29+
// this is needed cause instanceof doesn't work for
30+
// custom Errors when TS is compiled to es5
31+
Object.setPrototypeOf(this, OptimizelyError.prototype);
2832
}
2933

3034
getMessage(resolver?: MessageResolver): string {

0 commit comments

Comments
 (0)