Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/syncProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class FTPSyncProvider implements ISyncProvider {

/**
* Converts a file path (ex: "folder/otherfolder/file.txt") to an array of folder and a file path
* @param fullPath
* @param fullPath
*/
private getFileBreadcrumbs(fullPath: string): IFilePath {
// todo see if this regex will work for nonstandard folder names
Expand Down Expand Up @@ -110,7 +110,7 @@ export class FTPSyncProvider implements ISyncProvider {
}
catch (e: any) {
// this error is common when a file was deleted on the server directly
if (e.code === ErrorCode.FileNotFoundOrNoAccess) {
if (e?.code === ErrorCode.FileNotFoundOrNoAccess) {
this.logger.standard("File not found or you don't have access to the file - skipping...");
}
else {
Expand All @@ -128,7 +128,17 @@ export class FTPSyncProvider implements ISyncProvider {
this.logger.all(`removing folder "${absoluteFolderPath}"`);

if (this.dryRun === false) {
await retryRequest(this.logger, async () => await this.client.removeDir(absoluteFolderPath));
try {
await retryRequest(this.logger, async () => await this.client.removeDir(absoluteFolderPath));
}
catch (e: any) {
if (e?.code === ErrorCode.FileNotFoundOrNoAccess) {
this.logger.standard("Directory not found or you don't have access to the file - skipping...");
}
else {
throw e;
}
}
}

this.logger.verbose(` completed`);
Expand Down