mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
replace numbers with typed http status codes (#3409)
This commit is contained in:
parent
adc1f09c0d
commit
2d53be0267
149 changed files with 1721 additions and 1108 deletions
|
@ -6,6 +6,7 @@ import { getOrCreateVideoAndAccountAndChannel } from '@server/lib/activitypub/vi
|
|||
import { AccountBlocklistModel } from '@server/models/account/account-blocklist'
|
||||
import { getServerActor } from '@server/models/application/application'
|
||||
import { ServerBlocklistModel } from '@server/models/server/server-blocklist'
|
||||
import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
|
||||
import { ResultList, Video, VideoChannel } from '@shared/models'
|
||||
import { SearchTargetQuery } from '@shared/models/search/search-target-query.model'
|
||||
import { VideoChannelsSearchQuery, VideosSearchQuery } from '../../../shared/models/search'
|
||||
|
@ -99,7 +100,7 @@ async function searchVideoChannelsIndex (query: VideoChannelsSearchQuery, res: e
|
|||
} catch (err) {
|
||||
logger.warn('Cannot use search index to make video channels search.', { err })
|
||||
|
||||
return res.sendStatus(500)
|
||||
return res.sendStatus(HttpStatusCode.INTERNAL_SERVER_ERROR_500)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -191,7 +192,7 @@ async function searchVideosIndex (query: VideosSearchQuery, res: express.Respons
|
|||
} catch (err) {
|
||||
logger.warn('Cannot use search index to make video search.', { err })
|
||||
|
||||
return res.sendStatus(500)
|
||||
return res.sendStatus(HttpStatusCode.INTERNAL_SERVER_ERROR_500)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue