aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-01-18 09:19:59 +0100
committerChocobozzz <me@florianbigard.com>2022-01-18 09:19:59 +0100
commit743dab5517d4501f6b35cfc795de6c8b6f41ebb3 (patch)
tree210608ce3f8310f3a2811e747e48b5689c12e962
parent4dfd57ae6f7dd2d014c3353111a2428a2288a588 (diff)
downloadPeerTube-743dab5517d4501f6b35cfc795de6c8b6f41ebb3.tar.gz
PeerTube-743dab5517d4501f6b35cfc795de6c8b6f41ebb3.tar.zst
PeerTube-743dab5517d4501f6b35cfc795de6c8b6f41ebb3.zip
Better 413 error handling in cli script
-rw-r--r--server/tools/peertube-upload.ts8
1 files changed, 7 insertions, 1 deletions
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) {
63 console.log(`Video ${options.videoName} uploaded.`) 63 console.log(`Video ${options.videoName} uploaded.`)
64 process.exit(0) 64 process.exit(0)
65 } catch (err) { 65 } catch (err) {
66 console.error(require('util').inspect(err)) 66 const message = err.message || ''
67 if (message.includes('413')) {
68 console.error('Aborted: the video file you try to upload it too big for this PeerTube instance.')
69 } else {
70 console.error(require('util').inspect(err))
71 }
72
67 process.exit(-1) 73 process.exit(-1)
68 } 74 }
69} 75}