Better 413 error handling in cli script
This commit is contained in:
parent
4dfd57ae6f
commit
743dab5517
1 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue