File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { promises as fs } from "fs";
33import path from "path" ;
44
55export class LocalStorageAdapter implements IStorageAdapter {
6- baseDir : string ;
6+ private baseDir : string ;
77
88 constructor ( baseDir : string ) {
99 this . baseDir = baseDir ;
@@ -25,8 +25,14 @@ export class LocalStorageAdapter implements IStorageAdapter {
2525 const fullPath = path . join ( this . baseDir , key ) ;
2626 try {
2727 await fs . unlink ( fullPath ) ;
28- } catch {
29- //ignore error if file does not exist
28+ } catch ( error ) {
29+ const err = error as NodeJS . ErrnoException ;
30+ if ( err ?. code === "ENOENT" || err ?. code === "ENOTDIR" ) {
31+ return ;
32+ }
33+
34+ console . error ( `Failed to delete file at ${ fullPath } : ` , error ) ;
35+ throw error
3036 }
3137 }
3238
You can’t perform that action at this time.
0 commit comments