lbry-sdk/lbry/extras
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
..
daemon exchange_rate_manager: raise exception if 'error' is in json_response 2021-07-19 13:41:49 -04:00
__init__.py moved lbry up one level 2020-01-01 15:57:56 -05:00
cli.py remove loggly 2020-06-24 11:13:29 -04:00
system_info.py build_type.py -> build_info.py 2020-01-23 13:13:19 -05:00