diff options
author | crupest <crupest@outlook.com> | 2024-11-11 01:12:29 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-01-16 21:14:14 +0800 |
commit | a7bbf582b695bb25d1e01152a9e037ad3b34e954 (patch) | |
tree | 4b3d969850981094ba33e18ac9ec49fbc409dc93 /tools/cru-py/cru/service/__main__.py | |
parent | bde8bf4e445e96f7a4981a488d9552bb2f00e3fa (diff) | |
download | crupest-a7bbf582b695bb25d1e01152a9e037ad3b34e954.tar.gz crupest-a7bbf582b695bb25d1e01152a9e037ad3b34e954.tar.bz2 crupest-a7bbf582b695bb25d1e01152a9e037ad3b34e954.zip |
HALF WORK: 2024.1.16
Diffstat (limited to 'tools/cru-py/cru/service/__main__.py')
-rw-r--r-- | tools/cru-py/cru/service/__main__.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/cru-py/cru/service/__main__.py b/tools/cru-py/cru/service/__main__.py index c218bc6..1c10e82 100644 --- a/tools/cru-py/cru/service/__main__.py +++ b/tools/cru-py/cru/service/__main__.py @@ -1,4 +1,4 @@ -from cru import CruUserFriendlyException +from cru import CruException from ._app import create_app @@ -11,6 +11,10 @@ def main(): if __name__ == "__main__": try: main() - except CruUserFriendlyException as e: - print(f"Error: {e.user_message}") - exit(1) + except CruException as e: + user_message = e.get_user_message() + if user_message is not None: + print(f"Error: {user_message}") + exit(1) + else: + raise |