aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/search.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/search.ts')
-rw-r--r--server/controllers/api/search.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/controllers/api/search.ts b/server/controllers/api/search.ts
index 6e2d11d93..353fd171b 100644
--- a/server/controllers/api/search.ts
+++ b/server/controllers/api/search.ts
@@ -6,6 +6,7 @@ import { getOrCreateVideoAndAccountAndChannel } from '@server/lib/activitypub/vi
6import { AccountBlocklistModel } from '@server/models/account/account-blocklist' 6import { AccountBlocklistModel } from '@server/models/account/account-blocklist'
7import { getServerActor } from '@server/models/application/application' 7import { getServerActor } from '@server/models/application/application'
8import { ServerBlocklistModel } from '@server/models/server/server-blocklist' 8import { ServerBlocklistModel } from '@server/models/server/server-blocklist'
9import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
9import { ResultList, Video, VideoChannel } from '@shared/models' 10import { ResultList, Video, VideoChannel } from '@shared/models'
10import { SearchTargetQuery } from '@shared/models/search/search-target-query.model' 11import { SearchTargetQuery } from '@shared/models/search/search-target-query.model'
11import { VideoChannelsSearchQuery, VideosSearchQuery } from '../../../shared/models/search' 12import { VideoChannelsSearchQuery, VideosSearchQuery } from '../../../shared/models/search'
@@ -99,7 +100,7 @@ async function searchVideoChannelsIndex (query: VideoChannelsSearchQuery, res: e
99 } catch (err) { 100 } catch (err) {
100 logger.warn('Cannot use search index to make video channels search.', { err }) 101 logger.warn('Cannot use search index to make video channels search.', { err })
101 102
102 return res.sendStatus(500) 103 return res.sendStatus(HttpStatusCode.INTERNAL_SERVER_ERROR_500)
103 } 104 }
104} 105}
105 106
@@ -191,7 +192,7 @@ async function searchVideosIndex (query: VideosSearchQuery, res: express.Respons
191 } catch (err) { 192 } catch (err) {
192 logger.warn('Cannot use search index to make video search.', { err }) 193 logger.warn('Cannot use search index to make video search.', { err })
193 194
194 return res.sendStatus(500) 195 return res.sendStatus(HttpStatusCode.INTERNAL_SERVER_ERROR_500)
195 } 196 }
196} 197}
197 198