diff --git a/src/cli.py b/src/cli.py index 6eb71a7..32b9e4b 100644 --- a/src/cli.py +++ b/src/cli.py @@ -63,7 +63,10 @@ def run(self, lat=None, long=None, args=None): def _save_report(self, ocean_data_dict): """Persists the report to the database if a handler is available.""" if self.db_handler: - self.db_handler.insert_report(ocean_data_dict) + try: + self.db_handler.insert_report(ocean_data_dict) + except Exception: + logger.warning("Failed to save report to database.") def _render_output(self, ocean_data_dict, arguments): """Renders JSON or human-readable output based on arguments."""