File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -77,13 +77,10 @@ DDPClient.prototype._recoverNetworkError = function() {
7777///////////////////////////////////////////////////////////////////////////
7878// RAW, low level functions
7979DDPClient . prototype . _send = function ( data ) {
80- try {
81- this . socket . send ( JSON . stringify ( data ) ) ;
82- }
83- catch ( error ) {
84- // The socket will throw a socket-error event and we will recover.
85- // This message will be lost however.
86- }
80+ this . socket . send ( JSON . stringify ( data ) , function ( error ) {
81+ // This callback to avoid an exception being thrown.
82+ // if an error happened, the socket will throw an event and we will recover.
83+ } ) ;
8784} ;
8885
8986// handle a message from the server
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ describe("Network errors", function() {
9898
9999 ddpclient . call ( 'aServerMethod' , [ 42 ] , callCB ) ;
100100
101+ // First of all, the previous call should not throw anything.
101102 // The method callback should not be called
102103 // The socket-error event should not be triggered now
103104 // (but it will be triggered later by the socket)
You can’t perform that action at this time.
0 commit comments