ActivityPub-federated video streaming platform using P2P directly in your web browser
Prevent too big error log
Chocobozzz0da35bb877b9
diff --git a/server/core/helpers/requests.ts b/server/core/helpers/requests.tsindex de457bdad9..6e0147e43e 100644--- a/server/core/helpers/requests.ts+++ b/server/core/helpers/requests.ts@@ -221,6 +221,8 @@ export function isBinaryResponse (result: Response<any>) {}export function buildRequestError (error: RequestError) {+ if (!error.response && !error.options) return error+const newError: PeerTubeRequestError = new Error(error.message)newError.name = error.namenewError.stack = error.stackdiff --git a/server/core/lib/video-download.ts b/server/core/lib/video-download.tsindex 1fbb279573..622fc0839f 100644--- a/server/core/lib/video-download.ts+++ b/server/core/lib/video-download.ts@@ -109,7 +109,9 @@ export class VideoDownload {const { input, isTmpDestination } = await this.buildMuxInput(videoFile,- err => {+ errArg => {+ const err = buildRequestError(errArg as any)+logger.warn(`Cannot build mux input of video ${this.video.url}`, {err,inputs: this.inputsToLog(),@@ -119,7 +121,7 @@ export class VideoDownload {this.cleanup().catch(cleanupErr => logger.error('Cannot cleanup after mux error', { err: cleanupErr, ...lTags(this.video.uuid) }))- rej(buildRequestError(err as any))+ rej(err)})