diff --git a/python/fbprophet/make_holidays.py b/python/fbprophet/make_holidays.py index 7da7095..27b3c49 100644 --- a/python/fbprophet/make_holidays.py +++ b/python/fbprophet/make_holidays.py @@ -34,9 +34,9 @@ def get_holiday_names(country): except AttributeError: try: holiday_names = getattr(hdays_part1, country)(years=years).values() - except AttributeError: + except AttributeError as e: raise AttributeError( - "Holidays in {} are not currently supported!".format(country)) + "Holidays in {} are not currently supported!".format(country)) from e return set(holiday_names) @@ -58,9 +58,9 @@ def make_holidays_df(year_list, country, province=None): except AttributeError: try: holidays = getattr(hdays_part1, country)(prov=province,years=year_list) - except AttributeError: + except AttributeError as e: raise AttributeError( - "Holidays in {} are not currently supported!".format(country)) + "Holidays in {} are not currently supported!".format(country)) from e holidays_df = pd.DataFrame(list(holidays.items()), columns=['ds', 'holiday']) holidays_df.reset_index(inplace=True, drop=True) holidays_df['ds'] = pd.to_datetime(holidays_df['ds']) diff --git a/python/fbprophet/models.py b/python/fbprophet/models.py index de03333..dc77a6b 100644 --- a/python/fbprophet/models.py +++ b/python/fbprophet/models.py @@ -271,5 +271,5 @@ class StanBackendEnum(Enum): def get_backend_class(name: str) -> IStanBackend: try: return StanBackendEnum[name].value - except KeyError: - raise ValueError("Unknown stan backend: {}".format(name)) + except KeyError as e: + raise ValueError("Unknown stan backend: {}".format(name)) from e