Repository: tellor-io/telliot-feeds (language: python)

Issue:
TypeError: argument of type 'NoneType' is not iterable (listening for tips)
Got this error after updating to the latest main branch yesterday night (01-21-2023) for one of our testnet reporters. This one was set to listen for tips with the start command: `telliot report -a mumbai3 -wp 60`

All the other reporters are stable so far.

See attached log for traceback.
[traceback_log.txt](https://github.com/tellor-io/telliot-feeds/files/10474890/traceback_log.txt)



Discussion / hints:

Fix patch:
diff --git a/src/telliot_feeds/sources/price/spot/bittrex.py b/src/telliot_feeds/sources/price/spot/bittrex.py
index 89e7022c..3eeed82d 100644
--- a/src/telliot_feeds/sources/price/spot/bittrex.py
+++ b/src/telliot_feeds/sources/price/spot/bittrex.py
@@ -52,11 +52,15 @@ async def get_price(self, asset: str, currency: str) -> OptionalDataPoint[float]
                 logger.error("Unable to decode Bittrex JSON")
                 return None, None
 
-            if "restrictions that prevent you from accessing the site" in d["exception"].strerror:
+            rate_limit_conditions = (
+                "exception" in d,
+                "restrictions that prevent you from accessing the site" in str(d["exception"]),
+            )
+            if all(rate_limit_conditions):
                 logger.warning("Bittrex API rate limit exceeded")
                 return None, None
 
-            logger.error(d)
+            logger.error(str(d))
             return None, None
 
         else:


Test patch:
diff --git a/tests/sources/test_spot_price_sources.py b/tests/sources/test_spot_price_sources.py
index 5028a330..c1c82d4a 100644
--- a/tests/sources/test_spot_price_sources.py
+++ b/tests/sources/test_spot_price_sources.py
@@ -158,6 +158,30 @@ async def test_bittrex(caplog):
     else:
         validate_price(v, t)
 
+    # test rate limiting
+    def mock_get_url(*args, **kwargs):
+        return {"error": "blah", "exception": Exception("restrictions that prevent you from accessing the site")}
+
+    with mock.patch(
+        "telliot_feeds.sources.price.spot.bittrex.BittrexSpotPriceService.get_url", side_effect=mock_get_url
+    ):
+        v, t = await get_price("btc", "usd", service["bittrex"])
+        assert v is None
+        assert t is None
+        assert "Bittrex API rate limit exceeded" in caplog.text
+
+    # test unknown error
+    def mock_get_url2(*args, **kwargs):
+        return {"error": "bingo", "exception": Exception("bango")}
+
+    with mock.patch(
+        "telliot_feeds.sources.price.spot.bittrex.BittrexSpotPriceService.get_url", side_effect=mock_get_url2
+    ):
+        v, t = await get_price("btc", "usd", service["bittrex"])
+        assert v is None
+        assert t is None
+        assert "Exception('bango')" in caplog.text
+
 
 @pytest.mark.asyncio
 async def test_gemini(caplog, monkeypatch):