Skip to content

Commit

Permalink
Continue trying transfer strategies even after unexpected errors. (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickjuchli committed Oct 31, 2020
1 parent abc182c commit d077aef
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -768,12 +768,8 @@ export class Client {
return res
}
catch(err) {
// Receiving an FTPError means that the last transfer strategy failed and we should
// try the next one. Any other exception should stop the evaluation of strategies because
// something else went wrong.
if (!(err instanceof FTPError)) {
throw err
}
// Try the next candidate no matter the exact error. It's possible that a server
// answered incorrectly to a strategy, for example a PASV answer to an EPSV.
}
}
throw new Error("None of the available transfer strategies work.")
Expand Down

0 comments on commit d077aef

Please sign in to comment.