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
|
statusCode?: number
|
||||||
responseBody?: any
|
responseBody?: any
|
||||||
responseHeaders?: any
|
responseHeaders?: any
|
||||||
|
requestHeaders?: any
|
||||||
}
|
}
|
||||||
|
|
||||||
type PeerTubeRequestOptions = {
|
type PeerTubeRequestOptions = {
|
||||||
|
@ -243,5 +244,9 @@ function buildRequestError (error: RequestError) {
|
||||||
newError.statusCode = error.response.statusCode
|
newError.statusCode = error.response.statusCode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (error.options) {
|
||||||
|
newError.requestHeaders = error.options.headers
|
||||||
|
}
|
||||||
|
|
||||||
return newError
|
return newError
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue