Skip to content

Commit e49b4a4

Browse files
author
3aa49ec6bfc910647fa1c5a013e48eef
committed
Refactor unmountTeslaCam function to handle error when unmounting TeslaCam
1 parent 1b56c0d commit e49b4a4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/worker/modules/storage.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ export const mountTeslaCamAsReadWrite = async () => {
1313

1414
export const unmountTeslaCam = async () => {
1515
logWithTimestamp("Unmounting TeslaCam")
16-
await executeBashCommand("sudo umount /mnt/TeslaCam && systemctl daemon-reload")
16+
try {
17+
await executeBashCommand("sudo umount /mnt/TeslaCam && systemctl daemon-reload")
18+
} catch (error) {
19+
errorWithTimestamp("Unable to unmount TeslaCam, this is OK if it wasn't meant to be mounted.")
20+
}
1721
}
1822

1923
export const unmountUsbDriveFromHost = async () => {

0 commit comments

Comments
 (0)