Skip to content

Commit 0aab95b

Browse files
add catches to exit handler deletions
1 parent f804c72 commit 0aab95b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/libraries/Executor.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,20 @@ class Executor {
9494
this.DBDestroySignal.abort()
9595

9696
if (options._DO_NOT_USE_deleteDBAfterStopped) {
97-
fs.rmSync(options._DO_NOT_USE_dbPath, {recursive: true, maxRetries: 50, force: true})
97+
try {
98+
fs.rmSync(options._DO_NOT_USE_dbPath, {recursive: true, maxRetries: 50, force: true})
99+
} catch (e) {
100+
this.logger.error('An error occurred while deleting database directory path:', e)
101+
}
98102
}
99103

100104
const binaryPathToDelete = this.#returnBinaryPathToDelete(binaryFilepath, options)
101105
if (binaryPathToDelete) {
102-
fs.rmSync(binaryPathToDelete, {force: true, recursive: true, maxRetries: 50})
106+
try {
107+
fs.rmSync(binaryPathToDelete, {force: true, recursive: true, maxRetries: 50})
108+
} catch (e) {
109+
this.logger.error('An error occurred while deleting database binary:', e)
110+
}
103111
}
104112
})
105113

0 commit comments

Comments
 (0)