aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-26 15:54:13 +0200
committerChocobozzz <me@florianbigard.com>2018-03-26 16:04:14 +0200
commitd5b7d9110dd637a7f67ce9e430145314812a8df1 (patch)
treed019ef5fe68b14d7e5ad11953b6c1f4811669ce6 /server.ts
parent0dcf9a14be3f8668fe5ee65cf0365d457b4d1499 (diff)
downloadPeerTube-d5b7d9110dd637a7f67ce9e430145314812a8df1.tar.gz
PeerTube-d5b7d9110dd637a7f67ce9e430145314812a8df1.tar.zst
PeerTube-d5b7d9110dd637a7f67ce9e430145314812a8df1.zip
Fix error logging
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts14
1 files changed, 10 insertions, 4 deletions
diff --git a/server.ts b/server.ts
index 56a4a0c44..f6794b897 100644
--- a/server.ts
+++ b/server.ts
@@ -27,13 +27,21 @@ const app = express()
27// ----------- Core checker ----------- 27// ----------- Core checker -----------
28import { checkMissedConfig, checkFFmpeg, checkConfig } from './server/initializers/checker' 28import { checkMissedConfig, checkFFmpeg, checkConfig } from './server/initializers/checker'
29 29
30// Do not use barrels because we don't want to load all modules here (we need to initialize database first)
31import { logger } from './server/helpers/logger'
32import { ACCEPT_HEADERS, API_VERSION, CONFIG, STATIC_PATHS } from './server/initializers/constants'
33
30const missed = checkMissedConfig() 34const missed = checkMissedConfig()
31if (missed.length !== 0) { 35if (missed.length !== 0) {
32 throw new Error('Your configuration files miss keys: ' + missed) 36 logger.error('Your configuration files miss keys: ' + missed)
37 process.exit(-1)
33} 38}
34 39
35import { ACCEPT_HEADERS, API_VERSION, CONFIG, STATIC_PATHS } from './server/initializers/constants'
36checkFFmpeg(CONFIG) 40checkFFmpeg(CONFIG)
41 .catch(err => {
42 logger.error('Error in ffmpeg check.', { err })
43 process.exit(-1)
44 })
37 45
38const errorMessage = checkConfig() 46const errorMessage = checkConfig()
39if (errorMessage !== null) { 47if (errorMessage !== null) {
@@ -41,8 +49,6 @@ if (errorMessage !== null) {
41} 49}
42 50
43// ----------- Database ----------- 51// ----------- Database -----------
44// Do not use barrels because we don't want to load all modules here (we need to initialize database first)
45import { logger } from './server/helpers/logger'
46 52
47// Initialize database and models 53// Initialize database and models
48import { initDatabaseModels } from './server/initializers/database' 54import { initDatabaseModels } from './server/initializers/database'