Skip to content

Commit 5cf8d7f

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 5cf8d7f

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

src/providers/generic/file/NodeFs.ts

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,19 @@ 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> {
7268
return await NodeFs.lock.acquire([path, newPath], async () => {
7369
return await fs.promises.rename(path, newPath);
74-
}).catch(e) {
75-
throw e
76-
}
70+
});
7771
}
7872

7973
async chmod(path: string, mode: string | number): Promise<void> {
@@ -83,9 +77,7 @@ export default class NodeFs extends FsProvider {
8377
async copyFile(from: string, to: string): Promise<void> {
8478
return await NodeFs.lock.acquire([from, to], async () => {
8579
return await fs.promises.copyFile(from, to);
86-
}).catch(e) {
87-
throw e;
88-
}
80+
});
8981
}
9082

9183
async copyFolder(from: string, to: string): Promise<void> {
@@ -103,16 +95,12 @@ export default class NodeFs extends FsProvider {
10395
}
10496
return;
10597
})
106-
}.catch(e) {
107-
throw e;
108-
}
98+
};
10999
}
110100

111101
async setModifiedTime(path: string, time: Date): Promise<void> {
112102
return await NodeFs.lock.acquire(path, async () => {
113103
return await fs.promises.utimes(path, time, time);
114-
}).catch(e) {
115-
throw e;
116-
};
104+
});
117105
}
118106
}

0 commit comments

Comments
 (0)