Skip to content

Commit

Permalink
doc: more pythonic example in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
freaz committed Aug 15, 2023
1 parent 2a72df7 commit fd35f85
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions host/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,13 @@ try:
}
)
print(f"RESULT: {r}")
except Exception as e:
if isinstance(e, PerformError):
print(f"ERROR RESULT: {e.error_result}")
elif isinstance(e, UnexpectedError):
print(f"ERROR:", e, file=sys.stderr)
else:
raise e
except PerformError as e:
print(f"ERROR RESULT: {e.error_result}")
except UnexpectedError as e:
print(f"ERROR:", e, file = sys.stderr)
finally:
client.send_metrics_to_superface()
web_server.shutdown()
```

Then run the script with:
Expand Down

0 comments on commit fd35f85

Please sign in to comment.