Skip to content

Commit

Permalink
wrap deleting object in try and catch block
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisaCG committed Nov 27, 2024
1 parent a4e5350 commit 56ef541
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,12 @@ export async function deleteObjects(
})
);
}
// always deleting the object (file or main directory)
return Private.deleteSingleObject(driveName, options.path);
try {
// always deleting the object (file or main directory)
return Private.deleteSingleObject(driveName, options.path);
} catch (error) {
// deleting failed if directory didn't exist and was only part of a path
}
}

/**
Expand Down

0 comments on commit 56ef541

Please sign in to comment.