diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-12-08 21:16:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-08 21:16:10 +0100 |
commit | f2eb23cd87cf32b8fe545178143b5f49e06a58da (patch) | |
tree | af7d59945af70e28fd85047e2c688c59a908f548 /server/lib/activitypub/actor.ts | |
parent | c977fd3ec931c059111ddb2b8d6ddbb20b6b99a1 (diff) | |
download | PeerTube-f2eb23cd87cf32b8fe545178143b5f49e06a58da.tar.gz PeerTube-f2eb23cd87cf32b8fe545178143b5f49e06a58da.tar.zst PeerTube-f2eb23cd87cf32b8fe545178143b5f49e06a58da.zip |
emit more specific status codes on video upload (#3423)
- reduce http status codes list to potentially useful codes
- convert more codes to typed ones
- factorize html generator for error responses
Diffstat (limited to 'server/lib/activitypub/actor.ts')
-rw-r--r-- | server/lib/activitypub/actor.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts index fb5558ff6..52547536c 100644 --- a/server/lib/activitypub/actor.ts +++ b/server/lib/activitypub/actor.ts | |||
@@ -36,6 +36,7 @@ import { | |||
36 | } from '../../types/models' | 36 | } from '../../types/models' |
37 | import { extname } from 'path' | 37 | import { extname } from 'path' |
38 | import { getServerActor } from '@server/models/application/application' | 38 | import { getServerActor } from '@server/models/application/application' |
39 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
39 | 40 | ||
40 | // Set account keys, this could be long so process after the account creation and do not block the client | 41 | // Set account keys, this could be long so process after the account creation and do not block the client |
41 | function setAsyncActorKeys <T extends MActor> (actor: T) { | 42 | function setAsyncActorKeys <T extends MActor> (actor: T) { |
@@ -277,7 +278,7 @@ async function refreshActorIfNeeded <T extends MActorFull | MActorAccountChannel | |||
277 | 278 | ||
278 | const { result, statusCode } = await fetchRemoteActor(actorUrl) | 279 | const { result, statusCode } = await fetchRemoteActor(actorUrl) |
279 | 280 | ||
280 | if (statusCode === 404) { | 281 | if (statusCode === HttpStatusCode.NOT_FOUND_404) { |
281 | logger.info('Deleting actor %s because there is a 404 in refresh actor.', actor.url) | 282 | logger.info('Deleting actor %s because there is a 404 in refresh actor.', actor.url) |
282 | actor.Account | 283 | actor.Account |
283 | ? await actor.Account.destroy() | 284 | ? await actor.Account.destroy() |