aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2020-05-07 01:43:25 +0200
committerGravatar Numerlor <[email protected]>2020-05-07 01:43:25 +0200
commitc94c0eaef4ccb64ee3f664ed65837b1f5afd5c59 (patch)
tree299065d627154d566984264c1b2dd0f226b4a89c
parentUse new util function for uploading output. (diff)
Continue on failed connections.
Not using skipping the iteration but continuing directly caused `response_json` being checked but not defined in case of connection errors. Co-authored-by: MarkKoz <[email protected]>
-rw-r--r--bot/utils/__init__.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/bot/utils/__init__.py b/bot/utils/__init__.py
index 011e41227..41e54c3d5 100644
--- a/bot/utils/__init__.py
+++ b/bot/utils/__init__.py
@@ -39,6 +39,7 @@ async def send_to_paste_service(http_session: ClientSession, contents: str, *, e
f"Failed to connect to paste service at url {paste_url}, "
f"trying again ({attempt}/{FAILED_REQUEST_ATTEMPTS})."
)
+ continue
if "message" in response_json:
log.warning(f"Paste service returned error {response_json['message']} with status code {response.status}.")
return