Skip to content

Commit

Permalink
Add error handling for unresponsive endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Dylan Schultz <[email protected]>
  • Loading branch information
dylanschultzie committed Jul 6, 2024
1 parent 7d93b38 commit f169fbd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def request_json(url: str) -> dict:

def process_request():
peggo_state = request_json(f"{NODE_URL}/peggy/v1/module_state")

if not peggo_state:
return

network_nonce = int(peggo_state["state"]["last_observed_nonce"])
PEGGO_NETWORK_NONCE.set(network_nonce)

Expand Down

0 comments on commit f169fbd

Please sign in to comment.