diff options
Diffstat (limited to 'server.ts')
-rw-r--r-- | server.ts | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -121,7 +121,8 @@ import { updateStreamingPlaylistsInfohashesIfNeeded } from './server/lib/hls' | |||
121 | import { PluginsCheckScheduler } from './server/lib/schedulers/plugins-check-scheduler' | 121 | import { PluginsCheckScheduler } from './server/lib/schedulers/plugins-check-scheduler' |
122 | import { Hooks } from './server/lib/plugins/hooks' | 122 | import { Hooks } from './server/lib/plugins/hooks' |
123 | import { PluginManager } from './server/lib/plugins/plugin-manager' | 123 | import { PluginManager } from './server/lib/plugins/plugin-manager' |
124 | import { LiveManager } from '@server/lib/live-manager' | 124 | import { LiveManager } from './server/lib/live-manager' |
125 | import { HttpStatusCode } from './shared/core-utils/miscs/http-error-codes' | ||
125 | 126 | ||
126 | // ----------- Command line ----------- | 127 | // ----------- Command line ----------- |
127 | 128 | ||
@@ -210,7 +211,7 @@ if (cli.client) app.use('/', clientsRouter) | |||
210 | // Catch 404 and forward to error handler | 211 | // Catch 404 and forward to error handler |
211 | app.use(function (req, res, next) { | 212 | app.use(function (req, res, next) { |
212 | const err = new Error('Not Found') | 213 | const err = new Error('Not Found') |
213 | err['status'] = 404 | 214 | err['status'] = HttpStatusCode.NOT_FOUND_404 |
214 | next(err) | 215 | next(err) |
215 | }) | 216 | }) |
216 | 217 | ||
@@ -224,7 +225,7 @@ app.use(function (err, req, res, next) { | |||
224 | const sql = err.parent ? err.parent.sql : undefined | 225 | const sql = err.parent ? err.parent.sql : undefined |
225 | 226 | ||
226 | logger.error('Error in controller.', { err: error, sql }) | 227 | logger.error('Error in controller.', { err: error, sql }) |
227 | return res.status(err.status || 500).end() | 228 | return res.status(err.status || HttpStatusCode.INTERNAL_SERVER_ERROR_500).end() |
228 | }) | 229 | }) |
229 | 230 | ||
230 | const server = createWebsocketTrackerServer(app) | 231 | const server = createWebsocketTrackerServer(app) |