diff --git a/temp_file_trans_client/api.py b/temp_file_trans_client/api.py index ea36b87..9d7c7b1 100644 --- a/temp_file_trans_client/api.py +++ b/temp_file_trans_client/api.py @@ -7,8 +7,11 @@ CONFIG_PATH = os.path.join(os.path.dirname(__file__), 'config.json') def load_config(): if os.path.exists(CONFIG_PATH): - with open(CONFIG_PATH, 'r') as f: - return json.load(f) + try: + with open(CONFIG_PATH, 'r') as f: + return json.load(f) + except (json.JSONDecodeError, IOError): + return {"server_url": "http://localhost:5000", "default_expiry": "24h"} return {"server_url": "http://localhost:5000", "default_expiry": "24h"} def save_config(config):