1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-07-19 13:29:42 +02:00

handle exceptions

This commit is contained in:
Didier 2022-06-30 12:45:55 +00:00
parent f596ed0ebc
commit ab594c92ef

View file

@ -299,10 +299,9 @@ def mount_device(device):
"""Unmount USB device""" """Unmount USB device"""
def umount_device(): def umount_device():
if not USB_AUTO_MOUNT: if not USB_AUTO_MOUNT:
log("Unmounting device /media/box") if os.path.exists("/media/box"):
res = os.system("pumount /media/box") log("Unmounting device /media/box")
# print("Return type: ", res) res = os.system("pumount /media/box")
"""Main device loop""" """Main device loop"""
def device_loop(): def device_loop():
@ -462,9 +461,9 @@ def scan(mount_point, used):
shutil.copyfile(full_path, os.path.join(quanrantine_folder,file)) shutil.copyfile(full_path, os.path.join(quanrantine_folder,file))
except Exception as e : except Exception as e :
log("Unexpected error: %s" % e) log("Unexpected error: %s" % e)
log("Scan failed !")
if not CURSES: if not CURSES:
display_image("ERROR") display_image("ERROR")
waitMouseClick()
raise raise
update_bar(100) update_bar(100)
log("Scan done in %ds, %d files scanned, %d files infected" % log("Scan done in %ds, %d files scanned, %d files infected" %