From f837a3cabcec30b6d1dbd8efb0775924306a3bad Mon Sep 17 00:00:00 2001 From: Stexxen Date: Wed, 10 Jun 2015 00:37:50 +0100 Subject: [PATCH] Allow CloseEvent if present to be bubbled up. --- src/stomp.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stomp.coffee b/src/stomp.coffee index 69788a9..6fc54d7 100644 --- a/src/stomp.coffee +++ b/src/stomp.coffee @@ -314,11 +314,11 @@ class Client errorCallback?(frame) else @debug? "Unhandled frame: #{frame}" - @ws.onclose = => + @ws.onclose = (closeEvent) => msg = "Whoops! Lost connection to #{@ws.url}" @debug?(msg) @_cleanUp() - errorCallback?(msg) + errorCallback?(msg, closeEvent) @ws.onopen = => @debug?('Web Socket Opened...') headers["accept-version"] = Stomp.VERSIONS.supportedVersions()