File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ Tracker.prototype._requestHttp = function (requestUrl, opts) {
151151 var data = ''
152152 if ( res . statusCode !== 200 ) {
153153 res . resume ( ) // consume the whole stream
154- self . client . emit ( 'error' , new Error ( 'Invalid response code ' + res . statusCode + ' from tracker' ) )
154+ self . client . emit ( 'error' , new Error ( 'Invalid response code ' + res . statusCode + ' from tracker ' + requestUrl ) )
155155 return
156156 }
157157 res . on ( 'data' , function ( chunk ) {
@@ -182,14 +182,12 @@ Tracker.prototype._requestUdp = function (requestUrl, opts) {
182182 }
183183
184184 function error ( message ) {
185- self . client . emit ( 'error' , new Error ( message ) )
186- socket . close ( )
185+ self . client . emit ( 'error' , new Error ( message + ' (connecting to tracker ' + requestUrl + ')' ) )
186+ try { socket . close ( ) } catch ( e ) { }
187187 clearTimeout ( timeout )
188188 }
189189
190- socket . on ( 'error' , function ( err ) {
191- error ( err )
192- } )
190+ socket . on ( 'error' , error )
193191
194192 socket . on ( 'message' , function ( message , rinfo ) {
195193
You can’t perform that action at this time.
0 commit comments