Update variable name

This commit is contained in:
Mykola Mokhnach 2019-01-14 12:30:16 +01:00
parent 6f8d5d09ef
commit a1230c34eb
1 changed files with 4 additions and 4 deletions

View File

@ -184,14 +184,14 @@ export default class RFB extends EventTargetMixin {
this._sock.on('message', this._handle_message.bind(this)); this._sock.on('message', this._handle_message.bind(this));
this._sock.on('open', () => { this._sock.on('open', () => {
if (typeof options.onSocketOpen === "function") { if (typeof options.onSocketOpen === "function") {
let result; let errorDescription;
try { try {
result = options.onSocketOpen(this._sock._websocket); errorDescription = options.onSocketOpen(this._sock._websocket);
} catch (e) { } catch (e) {
return this._fail("onSocketOpen callback failed: " + e.stack); return this._fail("onSocketOpen callback failed: " + e.stack);
} }
if (result) { if (errorDescription) {
return this._fail("onSocketOpen callback failed: " + result); return this._fail("onSocketOpen callback failed: " + errorDescription);
} }
} }