Add more context to request error
This commit is contained in:
parent
f42fcb4b58
commit
f42dd5524b
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue