@@ -10,7 +10,7 @@ var inherits = require('util').inherits
10
10
, parseHeader = require ( '../wireprotocol/shared' ) . parseHeader
11
11
, decompress = require ( '../wireprotocol/compression' ) . decompress
12
12
, Response = require ( './commands' ) . Response
13
- , MongoError = require ( '../error ' )
13
+ , MongoNetworkError = require ( '../network_error ' )
14
14
, Logger = require ( './logger' )
15
15
, zlib = require ( 'zlib' )
16
16
, Snappy = require ( './utils' ) . retrieveSnappy ( )
@@ -190,7 +190,7 @@ var errorHandler = function(self) {
190
190
// Debug information
191
191
if ( self . logger . isDebug ( ) ) self . logger . debug ( f ( 'connection %s for [%s:%s] errored out with [%s]' , self . id , self . host , self . port , JSON . stringify ( err ) ) ) ;
192
192
// Emit the error
193
- if ( self . listeners ( 'error' ) . length > 0 ) self . emit ( "error" , MongoError . create ( err ) , self ) ;
193
+ if ( self . listeners ( 'error' ) . length > 0 ) self . emit ( "error" , MongoNetworkError . create ( err ) , self ) ;
194
194
}
195
195
}
196
196
@@ -201,7 +201,7 @@ var timeoutHandler = function(self) {
201
201
if ( self . logger . isDebug ( ) ) self . logger . debug ( f ( 'connection %s for [%s:%s] timed out' , self . id , self . host , self . port ) ) ;
202
202
// Emit timeout error
203
203
self . emit ( "timeout"
204
- , MongoError . create ( f ( "connection %s to %s:%s timed out" , self . id , self . host , self . port ) )
204
+ , MongoNetworkError . create ( f ( "connection %s to %s:%s timed out" , self . id , self . host , self . port ) )
205
205
, self ) ;
206
206
}
207
207
}
@@ -215,7 +215,7 @@ var closeHandler = function(self) {
215
215
// Emit close event
216
216
if ( ! hadError ) {
217
217
self . emit ( "close"
218
- , MongoError . create ( f ( "connection %s to %s:%s closed" , self . id , self . host , self . port ) )
218
+ , MongoNetworkError . create ( f ( "connection %s to %s:%s closed" , self . id , self . host , self . port ) )
219
219
, self ) ;
220
220
}
221
221
}
0 commit comments