From f2f898c26326af3deb5e25c7664d1911ebceee8a Mon Sep 17 00:00:00 2001 From: Yoshihiro OKUMURA Date: Wed, 18 Sep 2024 11:22:03 +0900 Subject: [PATCH] check the exception to unexpected responses from the server. --- mdrsclient/__main__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mdrsclient/__main__.py b/mdrsclient/__main__.py index 0ffd3df..ce02dc5 100644 --- a/mdrsclient/__main__.py +++ b/mdrsclient/__main__.py @@ -1,5 +1,6 @@ import argparse import sys +from json import JSONDecodeError from mdrsclient.commands import ( ChaclCommand, @@ -52,6 +53,9 @@ def main() -> None: except MDRSException as e: print(f"Error: {e}") sys.exit(2) + except JSONDecodeError: + print("Unexpected response returned. Please check the configuration or the server's operational status.") + sys.exit(2) except KeyboardInterrupt: sys.exit(130)