Skip to content

Commit 802b6ef

Browse files
committed
adjust exceptions
1 parent 8a31da6 commit 802b6ef

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

grobid_client/grobid_client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,16 @@ def _load_config(self, path="./config.json"):
7171
# Update the default config with values from the file
7272
file_config = json.loads(config_json)
7373
self.config.update(file_config)
74-
except FileNotFoundError:
74+
except FileNotFoundError as e:
7575
# If config file doesn't exist, keep using default values
76-
print("Using default configuration values.")
76+
print(f"Error: The specified config file {path} was not found.")
77+
raise e
7778
except json.JSONDecodeError as e:
7879
# If config exists, but it's invalid, we raise an exception
79-
print(f"Warning: Could not parse config file at {path}: {str(e)}")
80+
print(f"Error: Could not parse config file at {path}: {str(e)}")
8081
raise e
8182
except Exception as e:
82-
print(f"Warning: Error reading config file at {path}: {str(e)}")
83+
print(f"Error: Error reading config file at {path}: {str(e)}")
8384
raise e
8485

8586
def _test_server_connection(self):

0 commit comments

Comments
 (0)