Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lpicci96 committed May 24, 2024
1 parent efb5a1a commit 206e2d2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/imf_reader/weo/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,16 @@ def fetch_data(version: Tuple[Literal["April", "October"], int] | str = "latest"
return df
except NoDataError:
raise NoDataError(f"No data found for expected versions {version} and {roll_back_version(version)}")
except UnexpectedFileError:
raise UnexpectedFileError(f"Unable to parse data for version {version[0]} {version[1]}")
except Exception as e:
raise e

# Any other error, raise it
except UnexpectedFileError:
raise UnexpectedFileError(f"Unable to parse data for version {version[0]} {version[1]}")
except Exception as e:
raise e

else:
try:
Expand All @@ -308,6 +318,10 @@ def fetch_data(version: Tuple[Literal["April", "October"], int] | str = "latest"
return df
except NoDataError:
raise NoDataError(f"No data found for version {version[0]} {version[1]}")
except UnexpectedFileError:
raise UnexpectedFileError(f"Unable to parse data for version {version[0]} {version[1]}")
except Exception as e:
raise e



Expand Down

0 comments on commit 206e2d2

Please sign in to comment.