From 1d5a01b2c9e49ed3a24f8630374dc63a703a2187 Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Wed, 28 Apr 2021 22:36:25 -0700 Subject: CodeSnippets: add more detail to the request error message --- bot/exts/info/code_snippets.py | 5 +++-- 1 file 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 -- cgit v1.2.3