Skip to content

Commit

Permalink
Preserve error message from socket's error event
Browse files Browse the repository at this point in the history
The `close` event's argument is simply `true` on error, but the `error` event gets a real error object.
  • Loading branch information
Yogu committed Jun 16, 2015
1 parent 92ee037 commit 04fea5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/portscanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ portscanner.checkPortStatus = function(port, options, callback) {
// Return after the socket has closed
socket.on('close', function(exception) {
if(exception && !connectionRefused)
error = exception;
error = error || exception;
else
error = null;
callback(error, status)
Expand Down

0 comments on commit 04fea5d

Please sign in to comment.