From 663f22211a441746364da1052172f2c06a74c439 Mon Sep 17 00:00:00 2001 From: Michael Solomon Date: Fri, 20 Aug 2021 11:56:11 +0300 Subject: [PATCH] Update consumer.ts (#235) Co-authored-by: Michael Solomon --- src/consumer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/consumer.ts b/src/consumer.ts index 5d91f0d6..e43aa14d 100644 --- a/src/consumer.ts +++ b/src/consumer.ts @@ -264,7 +264,7 @@ export class Consumer extends EventEmitter { } catch (err) { if (err instanceof TimeoutError) { err.message = `Message handler timed out after ${this.handleMessageTimeout}ms: Operation timed out.`; - } else { + } else if (err instanceof Error) { err.message = `Unexpected message handler failure: ${err.message}`; } throw err;