mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 17:20:40 +00:00
Fix logging of cross-wiki API errors
Error messages included a non-existent 'code' parameter; use the curl error message instead. Also log the error status (which is there somewhere in 'response' but logstash doesn't manipulate JSON fields well). Bug: T328128 Change-Id: If295d7a3b397b22301986a226a54df908c2ccf4d
This commit is contained in:
parent
5f373567c5
commit
79ee292ca4
|
@ -245,9 +245,11 @@ class EchoForeignWikiRequest {
|
||||||
|
|
||||||
if ( !isset( $results[$wiki] ) ) {
|
if ( !isset( $results[$wiki] ) ) {
|
||||||
LoggerFactory::getInstance( 'Echo' )->warning(
|
LoggerFactory::getInstance( 'Echo' )->warning(
|
||||||
'Failed to fetch API response from {wiki}. Error code {code}',
|
'Failed to fetch API response from {wiki}. Error: {error}',
|
||||||
[
|
[
|
||||||
'wiki' => $wiki,
|
'wiki' => $wiki,
|
||||||
|
'error' => $response['response']['error'] ?? 'unknown',
|
||||||
|
'statusCode' => $statusCode,
|
||||||
'response' => $response['response'],
|
'response' => $response['response'],
|
||||||
'request' => $reqs[$wiki],
|
'request' => $reqs[$wiki],
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue