websocket-framed
Advanced tools
Comparing version 0.9.7 to 0.9.8
@@ -102,3 +102,8 @@ "use strict"; | ||
let frame = new Frame(this); | ||
frame.import(ev.data); | ||
try { | ||
frame.import(ev.data); | ||
} catch (ex) { | ||
this.emit("error", ex); | ||
return; | ||
} | ||
ev.frame = frame; | ||
@@ -110,5 +115,11 @@ this.emit("message", ev); | ||
let frame = new Frame(this); | ||
frame.set(frameData, replyTo); | ||
let data = frame.export(); | ||
this.ws.send(data); | ||
let data; | ||
try { | ||
frame.set(frameData, replyTo); | ||
data = frame.export(); | ||
this.ws.send(data); | ||
} catch (ex) { | ||
this.emit("error", ex); | ||
return; | ||
} | ||
return { frame, data }; | ||
@@ -115,0 +126,0 @@ } |
{ | ||
"name": "websocket-framed", | ||
"version": "0.9.7", | ||
"version": "0.9.8", | ||
"description": "Framed WebSocket Communication", | ||
@@ -5,0 +5,0 @@ "keywords": [ "websocket", "frame", "message" ], |
@@ -90,3 +90,9 @@ /* | ||
let frame = new Frame(this) | ||
frame.import(ev.data) | ||
try { | ||
frame.import(ev.data) | ||
} | ||
catch (ex) { | ||
this.emit("error", ex) | ||
return | ||
} | ||
ev.frame = frame | ||
@@ -98,5 +104,12 @@ this.emit("message", ev) | ||
let frame = new Frame(this) | ||
frame.set(frameData, replyTo) | ||
let data = frame.export() | ||
this.ws.send(data) | ||
let data | ||
try { | ||
frame.set(frameData, replyTo) | ||
data = frame.export() | ||
this.ws.send(data) | ||
} | ||
catch (ex) { | ||
this.emit("error", ex) | ||
return | ||
} | ||
return { frame, data } | ||
@@ -103,0 +116,0 @@ } |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
123922
847