Commit 5f35b740 authored by liuzheng712's avatar liuzheng712

test

parent b0d1dd94
...@@ -36,13 +36,12 @@ WSSHClient.prototype.connect = function (options) { ...@@ -36,13 +36,12 @@ WSSHClient.prototype.connect = function (options) {
}; };
this._connection.onmessage = function (evt) { this._connection.onmessage = function (evt) {
try{
options.onData(evt.data);
} catch (e) {
var data = JSON.parse(evt.data.toString()); var data = JSON.parse(evt.data.toString());
if (data.error !== undefined) {
options.onError(data.error); options.onError(data.error);
} }
else {
options.onData(data);
}
}; };
this._connection.onclose = function (evt) { this._connection.onclose = function (evt) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment