errors : Add program ending function

Add a function that quits the program using sys.exit.
This is useful when we enconter a fatal error.
This commit is contained in:
2026-01-31 11:54:23 +01:00
parent b0c165b8b0
commit 072c2a26e6

View File

@@ -1,6 +1,9 @@
# Copyright (C) 2025-2026 Paul Retourné
# SPDX-License-Identifier: GPL-3.0-or-later
from typing import NoReturn
import sys
class RemoteMountedError(Exception):
pass
@@ -12,3 +15,7 @@ class UnknownSSHError(Exception):
class FatalSyncError(Exception):
pass
def unisync_exit_fatal(reason:str) -> NoReturn:
print(reason)
sys.exit(1)