aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2021-04-28 22:36:25 -0700
committerGravatar MarkKoz <[email protected]>2021-04-28 22:36:25 -0700
commit1d5a01b2c9e49ed3a24f8630374dc63a703a2187 (patch)
tree6ce3fea15ffdf6c13970c08216ec42995d950e3f
parentCodeSnippets: use a lower log level for 404 responses (diff)
CodeSnippets: add more detail to the request error message
-rw-r--r--bot/exts/info/code_snippets.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/bot/exts/info/code_snippets.py b/bot/exts/info/code_snippets.py
index 5c6cb5ae2..3c8b862c3 100644
--- a/bot/exts/info/code_snippets.py
+++ b/bot/exts/info/code_snippets.py
@@ -229,10 +229,11 @@ class CodeSnippets(Cog):
snippet = await handler(**match.groupdict())
all_snippets.append((match.start(), snippet))
except ClientResponseError as error:
+ error_message = error.message # noqa: B306
log.log(
logging.DEBUG if error.status == 404 else logging.ERROR,
- f'Failed to fetch code snippet from {error.request_info.real_url}. '
- f'Status: {error.status}. Message: {error}.'
+ f'Failed to fetch code snippet from {match[0]!r}: {error.status} '
+ f'{error_message} for GET {error.request_info.real_url.human_repr()}'
)
# Sorts the list of snippets by their match index and joins them into a single message