Skip to content

Commit

Permalink
[BugFix] Raise on "Error Message" with FMP Econ Calendar (#6534)
Browse files Browse the repository at this point in the history
* Raise on FMP Error message

* bad indent
  • Loading branch information
deeleeramone authored Jun 24, 2024
1 parent 99153d4 commit 041e224
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import Any, Dict, List, Optional
from warnings import warn

from openbb_core.app.model.abstract.error import OpenBBError
from openbb_core.provider.abstract.fetcher import Fetcher
from openbb_core.provider.standard_models.economic_calendar import (
EconomicCalendarData,
Expand Down Expand Up @@ -124,6 +125,8 @@ async def get_one(url):
try:
result = await amake_request(url, **kwargs)
if result:
if "Error Message" in result:
raise OpenBBError(result["Error Message"])
results.extend(result)
except Exception as e:
if len(urls) == 1 or (len(urls) > 1 and n_urls == len(urls)):
Expand Down

0 comments on commit 041e224

Please sign in to comment.