Return from get if getGetSocket errors #92

Closed
wants to merge 1 commit into
from

Conversation

2 participants
@reywood

reywood commented Jul 7, 2014

Currently, if an error is returned by getGetSocket, then get will still try to go ahead with the download. This can happen if an attempt is made to download a non-existent file, and will produce an exception such as:

/Users/sean.dwyer/ws/node_modules/jsftp/lib/jsftp.js:429
      socket.on('readable', function() {
             ^
TypeError: Cannot call method 'on' of undefined
    at /Users/sean.dwyer/ws/node_modules/jsftp/lib/jsftp.js:429:14
    at f (/Users/sean.dwyer/ws/node_modules/jsftp/node_modules/once/once.js:16:25)
    at Array.cmdCallback [as 1] (/Users/sean.dwyer/ws/node_modules/jsftp/lib/jsftp.js:461:23)
    at Ftp.parse (/Users/sean.dwyer/ws/node_modules/jsftp/lib/jsftp.js:249:13)
    at Ftp.parseResponse (/Users/sean.dwyer/ws/node_modules/jsftp/lib/jsftp.js:161:8)
    at Stream.<anonymous> (/Users/sean.dwyer/ws/node_modules/jsftp/lib/jsftp.js:132:24)
    at Stream.EventEmitter.emit (events.js:95:17)
    at ResponseParser.reemit (/Users/sean.dwyer/ws/node_modules/jsftp/node_modules/event-stream/node_modules/duplexer/index.js:70:25)
    at ResponseParser.EventEmitter.emit (events.js:95:17)
    at ResponseParser.<anonymous> (_stream_readable.js:746:14)

@sergi sergi closed this in 149ae3d Jul 7, 2014

@sergi

This comment has been minimized.

Show comment Hide comment
@sergi

sergi Jul 7, 2014

Owner

Thanks for reporting!

Owner

sergi commented Jul 7, 2014

Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment