diff options
Diffstat (limited to 'server/tools')
-rw-r--r-- | server/tools/peertube-redundancy.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/tools/peertube-redundancy.ts b/server/tools/peertube-redundancy.ts index 1ab58a438..fe482daf4 100644 --- a/server/tools/peertube-redundancy.ts +++ b/server/tools/peertube-redundancy.ts | |||
@@ -7,6 +7,7 @@ import * as program from 'commander' | |||
7 | import { getAdminTokenOrDie, getServerCredentials } from './cli' | 7 | import { getAdminTokenOrDie, getServerCredentials } from './cli' |
8 | import { VideoRedundanciesTarget, VideoRedundancy } from '@shared/models' | 8 | import { VideoRedundanciesTarget, VideoRedundancy } from '@shared/models' |
9 | import { addVideoRedundancy, listVideoRedundancies, removeVideoRedundancy } from '@shared/extra-utils/server/redundancy' | 9 | import { addVideoRedundancy, listVideoRedundancies, removeVideoRedundancy } from '@shared/extra-utils/server/redundancy' |
10 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' | ||
10 | import validator from 'validator' | 11 | import validator from 'validator' |
11 | import * as CliTable3 from 'cli-table3' | 12 | import * as CliTable3 from 'cli-table3' |
12 | import { URL } from 'url' | 13 | import { URL } from 'url' |
@@ -124,9 +125,9 @@ async function addRedundancyCLI (options: { videoId: number }) { | |||
124 | 125 | ||
125 | process.exit(0) | 126 | process.exit(0) |
126 | } catch (err) { | 127 | } catch (err) { |
127 | if (err.message.includes(409)) { | 128 | if (err.message.includes(HttpStatusCode.CONFLICT_409)) { |
128 | console.error('This video is already duplicated by your instance.') | 129 | console.error('This video is already duplicated by your instance.') |
129 | } else if (err.message.includes(404)) { | 130 | } else if (err.message.includes(HttpStatusCode.NOT_FOUND_404)) { |
130 | console.error('This video id does not exist.') | 131 | console.error('This video id does not exist.') |
131 | } else { | 132 | } else { |
132 | console.error(err) | 133 | console.error(err) |