mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
tray/catch error in Websocket node to close #264
This commit is contained in:
parent
bc53d302ff
commit
62496d80d5
@ -96,7 +96,12 @@ module.exports = function(RED) {
|
||||
WebSocketListenerNode.prototype.handleEvent = function(id,/*socket*/socket,/*String*/event,/*Object*/data,/*Object*/flags){
|
||||
var msg;
|
||||
if (this.wholemsg) {
|
||||
try {
|
||||
msg = JSON.parse(data);
|
||||
}
|
||||
catch(err) {
|
||||
msg = { payload:data };
|
||||
}
|
||||
} else {
|
||||
msg = {
|
||||
payload:data
|
||||
|
Loading…
Reference in New Issue
Block a user