@@ -10,7 +10,7 @@ var inherits = require('util').inherits
1010 , parseHeader = require ( '../wireprotocol/shared' ) . parseHeader
1111 , decompress = require ( '../wireprotocol/compression' ) . decompress
1212 , Response = require ( './commands' ) . Response
13- , MongoError = require ( '../error ' )
13+ , MongoNetworkError = require ( '../network_error ' )
1414 , Logger = require ( './logger' )
1515 , zlib = require ( 'zlib' )
1616 , Snappy = require ( './utils' ) . retrieveSnappy ( )
@@ -190,7 +190,7 @@ var errorHandler = function(self) {
190190 // Debug information
191191 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 ) ) ) ;
192192 // 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 ) ;
194194 }
195195}
196196
@@ -201,7 +201,7 @@ var timeoutHandler = function(self) {
201201 if ( self . logger . isDebug ( ) ) self . logger . debug ( f ( 'connection %s for [%s:%s] timed out' , self . id , self . host , self . port ) ) ;
202202 // Emit timeout error
203203 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 ) )
205205 , self ) ;
206206 }
207207}
@@ -215,7 +215,7 @@ var closeHandler = function(self) {
215215 // Emit close event
216216 if ( ! hadError ) {
217217 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 ) )
219219 , self ) ;
220220 }
221221 }
0 commit comments