fix: add logging error stack on home server failure
This commit is contained in:
parent
9bd97b95e9
commit
f7471119e1
1 changed files with 17 additions and 12 deletions
|
@ -6,16 +6,21 @@ const homeServer = new HomeServer()
|
|||
const env: Env = new Env()
|
||||
env.load()
|
||||
|
||||
Promise.resolve(
|
||||
homeServer.start({
|
||||
dataDirectoryPath: `${__dirname}/../data`,
|
||||
logStreamCallback: (chunk: Buffer) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(chunk.toString())
|
||||
},
|
||||
environment: env.getAll(),
|
||||
}),
|
||||
).catch((error) => {
|
||||
try {
|
||||
Promise.resolve(
|
||||
homeServer.start({
|
||||
dataDirectoryPath: `${__dirname}/../data`,
|
||||
logStreamCallback: (chunk: Buffer) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(chunk.toString())
|
||||
},
|
||||
environment: env.getAll(),
|
||||
}),
|
||||
).catch((error) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Could not start server: ${error.message}`)
|
||||
})
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Could not start server: ${error.message}`)
|
||||
})
|
||||
console.error((error as Error).stack)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue