From 206e2d257a9714e2f3898a0909779a99a1e3dd43 Mon Sep 17 00:00:00 2001 From: Luca Picci Date: Fri, 24 May 2024 10:54:07 +0200 Subject: [PATCH] update --- src/imf_reader/weo/extract.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/imf_reader/weo/extract.py b/src/imf_reader/weo/extract.py index 1005827..b719bcd 100644 --- a/src/imf_reader/weo/extract.py +++ b/src/imf_reader/weo/extract.py @@ -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: @@ -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