Merge pull request #4874 from overleaf/jpa-web-recurly-unhandled

[web] emit error object instead of string from RecurlyWrapper.apiRequest

GitOrigin-RevId: 9fd6cac0b763a438063fdeb1f06bdaa4920024d9
This commit is contained in:
Jakob Ackermann 2021-08-25 10:24:52 +02:00 committed by Copybot
parent 19bb96bb20
commit 4a0af3abef

View file

@ -467,8 +467,10 @@ const RecurlyWrapper = {
},
'error returned from recurly'
)
// TODO: this should be an Error object not a string
error = `Recurly API returned with status code: ${response.statusCode}`
error = new OError(
`Recurly API returned with status code: ${response.statusCode}`,
{ statusCode: response.statusCode }
)
}
return callback(error, response, body)
})