[project-history] log context of failed history-v1 requests (#23078)

GitOrigin-RevId: a597efc46e00fc07cc6e5b71938c82f513c0b288
This commit is contained in:
Jakob Ackermann 2025-01-23 12:33:01 +00:00 committed by Copybot
parent c300d0adb1
commit 36c9772e0e

View file

@ -557,11 +557,11 @@ function _requestHistoryService(options, callback) {
if (res.statusCode >= 200 && res.statusCode < 300) {
callback(null, body)
} else {
const { method, url, qs } = requestOptions
error = new OError(
`history store a non-success status code: ${res.statusCode}`
`history store a non-success status code: ${res.statusCode}`,
{ method, url, qs, statusCode: res.statusCode }
)
error.statusCode = res.statusCode
error.body = body
logger.warn({ err: error }, error.message)
callback(error)
}