Skip to content

Commit

Permalink
fix syntax error found while testing
Browse files Browse the repository at this point in the history
  • Loading branch information
rwegener2 committed Feb 8, 2024
1 parent 8cb9cd9 commit c7cc03e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions icepyx/core/is2ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,10 @@ def extract_product(filepath, auth=None):
# ATL14 saves the short_name as an array ['ATL14']
product = product[0]
product = _validate_product(product)
except KeyError:
raise "Unable to parse the product name from file metadata"
except KeyError as e:
raise Exception(
"Unable to parse the product name from file metadata"
).with_traceback(e.__traceback__)

# Close the file reader
f.close()
Expand Down Expand Up @@ -421,8 +423,10 @@ def extract_version(filepath, auth=None):
if isinstance(version, bytes):
version = version.decode()

except KeyError:
raise "Unable to parse the version from file metadata"
except KeyError as e:
raise Exception(
"Unable to parse the version from file metadata"
).with_traceback(e.__traceback__)

# Close the file reader
f.close()
Expand Down

0 comments on commit c7cc03e

Please sign in to comment.