From 743dab5517d4501f6b35cfc795de6c8b6f41ebb3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 18 Jan 2022 09:19:59 +0100 Subject: Better 413 error handling in cli script --- server/tools/peertube-upload.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'server/tools') diff --git a/server/tools/peertube-upload.ts b/server/tools/peertube-upload.ts index 08bd5f2bb..47ac87acd 100644 --- a/server/tools/peertube-upload.ts +++ b/server/tools/peertube-upload.ts @@ -63,7 +63,13 @@ async function run (url: string, username: string, password: string) { console.log(`Video ${options.videoName} uploaded.`) process.exit(0) } catch (err) { - console.error(require('util').inspect(err)) + const message = err.message || '' + if (message.includes('413')) { + console.error('Aborted: the video file you try to upload it too big for this PeerTube instance.') + } else { + console.error(require('util').inspect(err)) + } + process.exit(-1) } } -- cgit v1.2.3