Added exception when trying to shear a file that doesn't exist

This commit is contained in:
2022-01-17 02:05:01 -05:00
parent 68ded52e8c
commit caa5fad0bc
+5 -1
View File
@@ -384,7 +384,11 @@ def remove_data(): # deletes an entry or folder from both the client and the se
s_exit()
if device_type == 'c':
system(f"ssh -p {port} {username_ssh}@{ip} \"rm -rf '{directory_ssh}{_entry_name}.gpg'\"")
remove(f"{directory}{_entry_name}.gpg")
try:
remove(f"{directory}{_entry_name}.gpg")
except FileNotFoundError:
print("\nThe file does not exist!\n")
s_exit()
# program start sequence