1
0
Fork 0

Better 413 error handling in cli script

This commit is contained in:
Chocobozzz 2022-01-18 09:19:59 +01:00
parent 4dfd57ae6f
commit 743dab5517
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -63,7 +63,13 @@ async function run (url: string, username: string, password: string) {
console.log(`Video ${options.videoName} uploaded.`) console.log(`Video ${options.videoName} uploaded.`)
process.exit(0) process.exit(0)
} catch (err) { } 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) process.exit(-1)
} }
} }