From a1230c34ebb81e83714063801adafc392c02844d Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Mon, 14 Jan 2019 12:30:16 +0100 Subject: [PATCH] Update variable name --- core/rfb.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/rfb.js b/core/rfb.js index d110eb25..76d13f0a 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -184,14 +184,14 @@ export default class RFB extends EventTargetMixin { this._sock.on('message', this._handle_message.bind(this)); this._sock.on('open', () => { if (typeof options.onSocketOpen === "function") { - let result; + let errorDescription; try { - result = options.onSocketOpen(this._sock._websocket); + errorDescription = options.onSocketOpen(this._sock._websocket); } catch (e) { return this._fail("onSocketOpen callback failed: " + e.stack); } - if (result) { - return this._fail("onSocketOpen callback failed: " + result); + if (errorDescription) { + return this._fail("onSocketOpen callback failed: " + errorDescription); } }