From d077aef50a7a3de27acff104aafb1dbf7026f689 Mon Sep 17 00:00:00 2001 From: Patrick Juchli Date: Sat, 31 Oct 2020 09:14:05 +0100 Subject: [PATCH] Continue trying transfer strategies even after unexpected errors. (#164) --- src/Client.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Client.ts b/src/Client.ts index 6deef6a..4a43eed 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -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.")