Skip to content

Commit fd05d48

Browse files
committed
Remove catch…throw blocks
Weird, I was sure I had fixed them before. Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
1 parent 9ce0b45 commit fd05d48

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

src/providers/generic/file/NodeFs.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,13 @@ export default class NodeFs extends FsProvider {
5555
async unlink(path: string): Promise<void> {
5656
return await NodeFs.lock.acquire(path, async () => {
5757
return await fs.promises.unlink(path);
58-
}).catch(e) {
59-
throw e;
60-
}
58+
});
6159
}
6260

6361
async writeFile(path: string, content: string | Buffer): Promise<void> {
6462
return await NodeFs.lock.acquire(path, () => {
6563
fs.writeFileSync(path, content);
66-
}).catch(e) {
67-
throw e;
68-
}
64+
});
6965
}
7066

7167
async rename(path: string, newPath: string): Promise<void> {
@@ -83,9 +79,7 @@ export default class NodeFs extends FsProvider {
8379
async copyFile(from: string, to: string): Promise<void> {
8480
return await NodeFs.lock.acquire([from, to], async () => {
8581
return await fs.promises.copyFile(from, to);
86-
}).catch(e) {
87-
throw e;
88-
}
82+
});
8983
}
9084

9185
async copyFolder(from: string, to: string): Promise<void> {
@@ -103,16 +97,12 @@ export default class NodeFs extends FsProvider {
10397
}
10498
return;
10599
})
106-
}.catch(e) {
107-
throw e;
108-
}
100+
};
109101
}
110102

111103
async setModifiedTime(path: string, time: Date): Promise<void> {
112104
return await NodeFs.lock.acquire(path, async () => {
113105
return await fs.promises.utimes(path, time, time);
114-
}).catch(e) {
115-
throw e;
116-
};
106+
});
117107
}
118108
}

0 commit comments

Comments
 (0)