From d6953f26a717232f03f098ef3e7dcb3b1d45a0ee Mon Sep 17 00:00:00 2001 From: Anthony <82120314+avvalenx@users.noreply.github.com> Date: Wed, 8 May 2024 19:00:17 -0500 Subject: [PATCH] added error messages for malformed and missing key in .harmony file to fix issue #168 (#170) * added error messages for malformed and missing key in .harmony file * documented .harmony error log changes in chagelog * updated changelog --------- Co-authored-by: Anthony Valen --- CHANGELOG.md | 3 +-- subscriber/podaac_access.py | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70a9659..c77c016 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## [Unreleased] -### Fixed ### Added -### Changed +- Added error messages to inform user if .harmony file is formatted incorrectly or missing a key ## [1.15.2] ### Fixed diff --git a/subscriber/podaac_access.py b/subscriber/podaac_access.py index a898569..0904b16 100644 --- a/subscriber/podaac_access.py +++ b/subscriber/podaac_access.py @@ -744,6 +744,10 @@ def find_harmony_runs(collection, bbox, starttime, endtime, output_dir, granules return x['jobid'] except FileNotFoundError: logging.warning('No .harmony file in the data directory. (Is this the first run?)') + except ValueError: + logging.error('.harmony file malformed') + except KeyError as key: + logging.error(f'.harmony file is missing {key}') return None