Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit ee72509

Browse files
committed
make 4xx error handling more generic
1 parent ea9e609 commit ee72509

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CloudFlare/cloudflare.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,8 @@ def _call_network(self, method, headers, parts, identifiers, params, data_str, d
332332
if self.logger:
333333
self.logger.debug('Response: 429 Header Retry-After: %s', retry_after)
334334

335-
# if (response_code >= 400 and response_code <= 499) or response_code == 500:
336-
if response_code in [400,401,403,404,405,412,500]:
335+
# if response_code in [400,401,403,404,405,412,500]:
336+
if 400 <= response_code <= 499 or response_code == 500:
337337
# The /certificates API call insists on a 500 error return and yet has valid error data
338338
# Other API calls can return 400 or 4xx with valid response data
339339
# lets check and convert if able

0 commit comments

Comments
 (0)