kopia lustrzana https://github.com/bugout-dev/moonstream
If try except order change
rodzic
f8c7de63a0
commit
4f17dfa998
|
@ -42,22 +42,22 @@ async def add_subscription_handler(
|
||||||
"""
|
"""
|
||||||
token = request.state.token
|
token = request.state.token
|
||||||
|
|
||||||
try:
|
if subscription_type_id != "ethereum_whalewatch":
|
||||||
if subscription_type_id != "ethereum_whalewatch":
|
try:
|
||||||
checksum_address = web3.toChecksumAddress(address)
|
checksum_address = web3.toChecksumAddress(address)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
raise MoonstreamHTTPException(
|
raise MoonstreamHTTPException(
|
||||||
status_code=400,
|
status_code=400,
|
||||||
detail=str(e),
|
detail=str(e),
|
||||||
internal_error=e,
|
internal_error=e,
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Failed to convert address to checksum address")
|
logger.error(f"Failed to convert address to checksum address")
|
||||||
raise MoonstreamHTTPException(
|
raise MoonstreamHTTPException(
|
||||||
status_code=500,
|
status_code=500,
|
||||||
internal_error=e,
|
internal_error=e,
|
||||||
detail="Currently unable to convert address to checksum address",
|
detail="Currently unable to convert address to checksum address",
|
||||||
)
|
)
|
||||||
|
|
||||||
active_subscription_types_response = subscription_types.list_subscription_types(
|
active_subscription_types_response = subscription_types.list_subscription_types(
|
||||||
active_only=True
|
active_only=True
|
||||||
|
|
Ładowanie…
Reference in New Issue