You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running into an issue when using the python module vs using requests.get(https://api.blockcypher/...)
When checking an address via requests, if the address is invalid a dict item is still returned.
{"error": "Address <invalid_address> is invalid: Address <invalid address> is of unknown size."}
When using the module, an assertion error is thrown for get_address_details() that will crash the script.
>>> response = blockcypher.get_address_details("<invalid addr>")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\X\AppData\Local\Programs\Python\Python38-32\lib\site-packages\blockcypher\api.py", line 122, in get_address_details
assert is_valid_address_for_coinsymbol(
AssertionError: <invalid addr>
This is rather inconvenient when iterating over a list of several addresses, if one happens to have a typo, be invalid etc. Would be easy to handle if the same dict["error"] was returned as in first example.
Please forgive if there's something simple I'm missing here.
The text was updated successfully, but these errors were encountered:
I'm running into an issue when using the python module vs using requests.get(https://api.blockcypher/...)
When checking an address via requests, if the address is invalid a dict item is still returned.
{"error": "Address <invalid_address> is invalid: Address <invalid address> is of unknown size."}
When using the module, an assertion error is thrown for get_address_details() that will crash the script.
This is rather inconvenient when iterating over a list of several addresses, if one happens to have a typo, be invalid etc. Would be easy to handle if the same dict["error"] was returned as in first example.
Please forgive if there's something simple I'm missing here.
The text was updated successfully, but these errors were encountered: