From bffa11308ec24abc6b0e57d5f129fcc3ca1d7985 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Fri, 8 Feb 2019 13:28:10 -0800 Subject: [PATCH] Fix issue where undefined is throw as connection error --- lib/connection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/connection.ts b/lib/connection.ts index 92b6d9b..6e41462 100644 --- a/lib/connection.ts +++ b/lib/connection.ts @@ -242,7 +242,7 @@ export class Connection extends Entity { onClose = (context: RheaEventContext) => { removeListeners(); - const err = context.error || context.connection.error; + const err = context.error || context.connection.error || Error('Failed to connect'); log.error("[%s] Error occurred while establishing amqp connection: %O", this.id, err); return reject(err);