added error handling in address_info endpoint

pull/236/head
yhtiyar 2021-09-15 12:20:52 +03:00
rodzic d6b135dbda
commit 26d57b1969
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -53,7 +53,11 @@ async def addressinfo_handler(
address: str,
db_session: Session = Depends(yield_db_session),
) -> Optional[data.EthereumAddressInfo]:
response = actions.get_ethereum_address_info(db_session, address)
try:
response = actions.get_ethereum_address_info(db_session, address)
except Exception as e:
logger.error(f"Unable to get info about Ethereum address {e}")
raise MoonstreamHTTPException(status_code=500, internal_error=e)
return response