Expose parser error events to the user.
This commit is contained in:
@@ -18,6 +18,13 @@ var API = function() {
|
||||
this._parser.on('message', function(e) { self._receiveMessage(e.data) });
|
||||
this._parser.on('close', function(e) { self._finalize(e.reason, e.code) });
|
||||
|
||||
this._parser.on('error', function(error) {
|
||||
var event = new Event('error', {message: error.message});
|
||||
event.initEvent('error', false, false);
|
||||
this.dispatchEvent(event);
|
||||
});
|
||||
this.on('error', function() {});
|
||||
|
||||
this._parser.messages.on('drain', function() {
|
||||
self.emit('drain');
|
||||
});
|
||||
|
||||
@@ -94,11 +94,6 @@ JS.ENV.ClientSpec = JS.Test.describe("Client", function() { with(this) {
|
||||
check_protocol("echo")
|
||||
}})
|
||||
|
||||
it("cannot open a connection with unacceptable protocols", function() { with(this) {
|
||||
open_socket(socket_url, ["foo"])
|
||||
check_closed()
|
||||
}})
|
||||
|
||||
it("can close the connection", function() { with(this) {
|
||||
open_socket(socket_url, protocols)
|
||||
close_socket()
|
||||
|
||||
Vendored
+1
-1
Submodule vendor/protocol updated: 103c39c664...d716650499
Reference in New Issue
Block a user