We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5bbe48b commit d56fb02Copy full SHA for d56fb02
examples/connection_check.py
@@ -42,10 +42,12 @@ def check_write():
42
try:
43
client.write_api(write_options=SYNCHRONOUS).write(bucket, org, b"")
44
except ApiException as e:
45
- # missing credentials
+ # bucket does not exist
46
if e.status == 404:
47
- raise Exception(f"The specified token doesn't have sufficient credentials to write to '{bucket}' "
48
- f"or specified bucket doesn't exists.") from e
+ raise Exception(f"The specified bucket does not exist.") from e
+ # insufficient permissions
49
+ if e.status == 403:
50
+ raise Exception(f"The specified token does not have sufficient credentials to write to '{bucket}'.") from e
51
# 400 (BadRequest) caused by empty LineProtocol
52
if e.status != 400:
53
raise
0 commit comments