Skip to content

Commit 0ad33d9

Browse files
committed
How to get http status in example
1 parent 431c499 commit 0ad33d9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/native_sync/using_etag.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
).if_matches_etag(original_e_tag).sync()
5454
except PubNubException as e:
5555
# We get an exception and after reading the error message we can see that the reason is that the eTag is outdated.
56-
print(f"Update failed: {e.get_error_message().get('message')}")
56+
print(f"Update failed: {e.get_error_message().get('message')}\nHTTP Status Code: {e.get_status_code()}")
57+
58+
5759
except Exception as e:
5860
print(f"Unexpected error: {e}")

0 commit comments

Comments
 (0)