lbry-sdk/lbry
belikor b7791d2845 exchange_rate_manager: raise exception if 'error' is in json_response
If the error is not handled, the running daemon will continuously
print the following error message:
```
Traceback (most recent call last):
  File "lbry/extras/daemon/exchange_rate_manager.py", line 77, in get_rate
  File "lbry/extras/daemon/exchange_rate_manager.py", line 189, in get_rate_from_response
KeyError: 0
```

This started happening when the UPBit exchange decided to delist
the LBC coin.

Normally `json_response` should be a dictionary, not a list,
so `json_response[0]` causes an error.

By checking for the `'error'` key, we can raise the proper exception.

Once this is done, the message will be a warning, not a traceback.
```
WARNING  lbry.extras.daemon.exchange_rate_manager:92:
Failed to get exchange rate from UPbit: result not found
```
2021-07-19 13:41:49 -04:00
..
blob add LRUCache with no prometheus metrics 2021-01-21 14:37:08 -05:00
blob_exchange non blocking blob creation 2020-04-23 00:35:08 -04:00
crypto fix decrypting invalid bytes with valid padding 2020-01-13 21:17:10 -05:00
dht use LRU caches for DHT metrics 2021-06-04 11:54:37 -03:00
error shorten error message for ServerPaymentFeeAboveMaxAllowed 2020-02-21 10:16:56 -05:00
extras exchange_rate_manager: raise exception if 'error' is in json_response 2021-07-19 13:41:49 -04:00
file Fix suggestion for issue #3240 2021-05-12 18:30:38 +03:00
schema country jurisdiction added to hub UDP protocol 2021-06-22 11:07:58 -04:00
stream if progress was made, retry without a delay 2021-05-27 18:24:58 -03:00
torrent tell progress, stop trying to read first piece 2020-05-07 04:04:55 -03:00
wallet limit request error logging to 16k 2021-07-07 18:39:38 -03:00
.dockerignore residual fixes after lbrynet -> lbry move 2019-06-20 22:50:39 -04:00
__init__.py v0.100.0 2021-06-22 13:33:03 -04:00
build_info.py include docker tag in build info 2020-01-23 13:13:19 -05:00
conf.py add concurrent_hub_requests conf 2021-06-24 21:21:19 -03:00
connection_manager.py pylint for lbry/connection_manager.py 2020-01-03 03:08:15 -05:00
constants.py moved lbry up one level 2020-01-01 15:57:56 -05:00
file_analysis.py convert sample_rate to integer and dont force a volume_filter 2020-07-14 21:49:25 -04:00
prometheus.py prometheus metrics for asyncio loop responsiveness 2021-01-01 15:25:31 -05:00
testcase.py added support to config for determining if value is set and implemented hub selection logic 2021-06-22 11:07:58 -04:00
utils.py remove the unregister call 2021-06-04 12:47:16 -03:00
winpaths.py moved lbry up one level 2020-01-01 15:57:56 -05:00