File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export class FTPSyncProvider implements ISyncProvider {
50
50
51
51
/**
52
52
* Converts a file path (ex: "folder/otherfolder/file.txt") to an array of folder and a file path
53
- * @param fullPath
53
+ * @param fullPath
54
54
*/
55
55
private getFileBreadcrumbs ( fullPath : string ) : IFilePath {
56
56
// todo see if this regex will work for nonstandard folder names
@@ -110,7 +110,7 @@ export class FTPSyncProvider implements ISyncProvider {
110
110
}
111
111
catch ( e : any ) {
112
112
// this error is common when a file was deleted on the server directly
113
- if ( e . code === ErrorCode . FileNotFoundOrNoAccess ) {
113
+ if ( e ? .code === ErrorCode . FileNotFoundOrNoAccess ) {
114
114
this . logger . standard ( "File not found or you don't have access to the file - skipping..." ) ;
115
115
}
116
116
else {
@@ -128,7 +128,17 @@ export class FTPSyncProvider implements ISyncProvider {
128
128
this . logger . all ( `removing folder "${ absoluteFolderPath } "` ) ;
129
129
130
130
if ( this . dryRun === false ) {
131
- await retryRequest ( this . logger , async ( ) => await this . client . removeDir ( absoluteFolderPath ) ) ;
131
+ try {
132
+ await retryRequest ( this . logger , async ( ) => await this . client . removeDir ( absoluteFolderPath ) ) ;
133
+ }
134
+ catch ( e : any ) {
135
+ if ( e ?. code === ErrorCode . FileNotFoundOrNoAccess ) {
136
+ this . logger . standard ( "Directory not found or you don't have access to the file - skipping..." ) ;
137
+ }
138
+ else {
139
+ throw e ;
140
+ }
141
+ }
132
142
}
133
143
134
144
this . logger . verbose ( ` completed` ) ;
You can’t perform that action at this time.
0 commit comments