Add more context to request error

pull/5898/head
Chocobozzz 2023-07-25 14:21:01 +02:00
parent f42fcb4b58
commit f42dd5524b
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 5 additions and 0 deletions

View File

@ -14,6 +14,7 @@ export interface PeerTubeRequestError extends Error {
statusCode?: number
responseBody?: any
responseHeaders?: any
requestHeaders?: any
}
type PeerTubeRequestOptions = {
@ -243,5 +244,9 @@ function buildRequestError (error: RequestError) {
newError.statusCode = error.response.statusCode
}
if (error.options) {
newError.requestHeaders = error.options.headers
}
return newError
}