X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftools%2Fpeertube-upload.ts;h=87da5500509eb0e896e4538f56f8526c583c4332;hb=2c015b54192f2080f756c424173bac2bd53e7ca9;hp=01fb1fe8d5e3e76151f91ed62426d94a029d0eb6;hpb=a24bd1ed41b43790bab6ba789580bb4e85f07d85;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tools/peertube-upload.ts b/server/tools/peertube-upload.ts index 01fb1fe8d..87da55005 100644 --- a/server/tools/peertube-upload.ts +++ b/server/tools/peertube-upload.ts @@ -1,10 +1,7 @@ -import { registerTSPaths } from '../helpers/register-ts-paths' -registerTSPaths() - import { program } from 'commander' import { access, constants } from 'fs-extra' import { isAbsolute } from 'path' -import { assignToken, buildCommonVideoOptions, buildServer, buildVideoAttributesFromCommander, getServerCredentials } from './cli' +import { assignToken, buildCommonVideoOptions, buildServer, buildVideoAttributesFromCommander, getServerCredentials } from './shared' let command = program .name('upload') @@ -66,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: user quota is exceeded or video file is too big for this PeerTube instance.') + } else { + console.error(require('util').inspect(err)) + } + process.exit(-1) } }