diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-25 14:21:01 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-25 14:21:01 +0200 |
commit | f42dd5524b47e89d9b4491f784f05a99303cc934 (patch) | |
tree | 779c374281072dc23a4d65d87738cd5eed408f11 | |
parent | f42fcb4b58f146c2e5ace236548a99d361ade55f (diff) | |
download | PeerTube-f42dd5524b47e89d9b4491f784f05a99303cc934.tar.gz PeerTube-f42dd5524b47e89d9b4491f784f05a99303cc934.tar.zst PeerTube-f42dd5524b47e89d9b4491f784f05a99303cc934.zip |
Add more context to request error
-rw-r--r-- | server/helpers/requests.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/helpers/requests.ts b/server/helpers/requests.ts index 1a3cc1b5b..201a7d7e3 100644 --- a/server/helpers/requests.ts +++ b/server/helpers/requests.ts | |||
@@ -14,6 +14,7 @@ export interface PeerTubeRequestError extends Error { | |||
14 | statusCode?: number | 14 | statusCode?: number |
15 | responseBody?: any | 15 | responseBody?: any |
16 | responseHeaders?: any | 16 | responseHeaders?: any |
17 | requestHeaders?: any | ||
17 | } | 18 | } |
18 | 19 | ||
19 | type PeerTubeRequestOptions = { | 20 | type PeerTubeRequestOptions = { |
@@ -243,5 +244,9 @@ function buildRequestError (error: RequestError) { | |||
243 | newError.statusCode = error.response.statusCode | 244 | newError.statusCode = error.response.statusCode |
244 | } | 245 | } |
245 | 246 | ||
247 | if (error.options) { | ||
248 | newError.requestHeaders = error.options.headers | ||
249 | } | ||
250 | |||
246 | return newError | 251 | return newError |
247 | } | 252 | } |