From e59dbf005ce99561c3aec484192e26e9d4315858 Mon Sep 17 00:00:00 2001 From: Anson Biggs Date: Sat, 6 Nov 2021 12:38:59 -0700 Subject: [PATCH] added warning about #83 --- IEX_Symbol.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/IEX_Symbol.py b/IEX_Symbol.py index 5b52141..cfd13d3 100644 --- a/IEX_Symbol.py +++ b/IEX_Symbol.py @@ -225,7 +225,8 @@ class IEX_Symbol: try: IEXData = resp[0] except IndexError as e: - return f"${symbol.id.upper()} either doesn't exist or pays no dividend." + logging.info(e) + return f"Getting dividend information for ${symbol.id.upper()} encountered an error. The provider for upcoming dividend information has been having issues recently which has likely caused this error. It is also possible that the stock has no dividend or does not exist." keys = ( "amount", "currency", @@ -266,7 +267,7 @@ class IEX_Symbol: + f"\n\nThe dividend was declared on {declared} and the ex-dividend date is {ex}" ) - return f"${symbol.id.upper()} either doesn't exist or pays no dividend." + return f"Getting dividend information for ${symbol.id.upper()} encountered an error. The provider for upcoming dividend information has been having issues recently which has likely caused this error. It is also possible that the stock has no dividend or does not exist." def news_reply(self, symbol: Stock) -> str: """Gets most recent, english, non-paywalled news