Fix context field using class instead of instance in error handling (#2627)

In process_site_result(), when a check_error is present, the context
field was set to str(CheckError) (the class itself) instead of
str(check_error) (the error instance). This caused the context to
contain the string representation of the class rather than the actual
error message.

Before fix: context = "<class 'maigret.errors.CheckError'>"
After fix: context = "Request timeout error: slow server"
This commit is contained in:
idontknow
2026-05-09 15:58:06 +08:00
committed by GitHub
parent 5c93b206e7
commit 9838176205
+1 -1
View File
@@ -715,7 +715,7 @@ def process_site_result(
MaigretCheckStatus.UNKNOWN,
query_time=response_time,
error=check_error,
context=str(CheckError),
context=str(check_error),
tags=fulltags,
)
elif check_type == "message":