Skip to content

Commit

Permalink
How to get http status in example
Browse files Browse the repository at this point in the history
  • Loading branch information
seba-aln committed Feb 7, 2025
1 parent 431c499 commit 0ad33d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/native_sync/using_etag.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
).if_matches_etag(original_e_tag).sync()
except PubNubException as e:
# We get an exception and after reading the error message we can see that the reason is that the eTag is outdated.
print(f"Update failed: {e.get_error_message().get('message')}")
print(f"Update failed: {e.get_error_message().get('message')}\nHTTP Status Code: {e.get_status_code()}")


except Exception as e:
print(f"Unexpected error: {e}")

0 comments on commit 0ad33d9

Please sign in to comment.