Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle upload errors

  • Loading branch information...
commit 76b42dce7dd8a36ac8508789c57e944b9f5334f0 1 parent 5fb6cd7
@bancek bancek authored
Showing with 10 additions and 4 deletions.
  1. +8 −2 lib/jsftp.js
  2. +2 −2 test/jsftp_test.js
View
10 lib/jsftp.js
@@ -598,8 +598,14 @@ Ftp.getPasvPort = function(text) {
called = true;
callback(err, socket);
} else {
- if (!Ftp.isMark(res.code) && doneCallback) {
- doneCallback(res)
+ if (doneCallback) {
+ if (err) {
+ doneCallback(err)
+ } else {
+ if (!Ftp.isMark(res.code)) {
+ doneCallback(err, res)
+ }
+ }
}
}
};
View
4 test/jsftp_test.js
@@ -313,7 +313,7 @@ describe("jsftp test suite", function() {
socket.end();
});
- }, function(res) {
+ }, function(err, res) {
assert.equal(res.code, 226);
ftp.raw.dele(remotePath, function(err, data) {
@@ -330,7 +330,7 @@ describe("jsftp test suite", function() {
assert.ok(err, err);
assert.equal(err.code, 550);
next();
- }, function(res) {
+ }, function(err, res) {
assert.ok(false);
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.