Skip to content

Commit 56ef541

Browse files
committed
wrap deleting object in try and catch block
1 parent a4e5350 commit 56ef541

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/requests.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,12 @@ export async function deleteObjects(
263263
})
264264
);
265265
}
266-
// always deleting the object (file or main directory)
267-
return Private.deleteSingleObject(driveName, options.path);
266+
try {
267+
// always deleting the object (file or main directory)
268+
return Private.deleteSingleObject(driveName, options.path);
269+
} catch (error) {
270+
// deleting failed if directory didn't exist and was only part of a path
271+
}
268272
}
269273

270274
/**

0 commit comments

Comments
 (0)