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