From be31ad5b8c5fbc6256155bb96e7149af11a968b7 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Thu, 13 Mar 2025 19:04:34 +0600 Subject: [PATCH] fix log not being printed issue --- lib/error/optimizly_error.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/error/optimizly_error.ts b/lib/error/optimizly_error.ts index 76e8f7734..658008bea 100644 --- a/lib/error/optimizly_error.ts +++ b/lib/error/optimizly_error.ts @@ -25,6 +25,10 @@ export class OptimizelyError extends Error { this.name = 'OptimizelyError'; this.baseMessage = baseMessage; this.params = params; + + // this is needed cause instanceof doesn't work for + // custom Errors when TS is compiled to es5 + Object.setPrototypeOf(this, OptimizelyError.prototype); } getMessage(resolver?: MessageResolver): string {