mirror of
https://github.com/pockethost/pockethost.git
synced 2025-03-30 15:08:30 +00:00
fix: improved docker launch error messages
This commit is contained in:
parent
1f683a37cd
commit
4f1fe0c81e
@ -190,7 +190,7 @@ export const createPocketbaseService = async (
|
||||
docker
|
||||
.run(
|
||||
`pockethost/pocketbase`,
|
||||
[bin, `--help`],
|
||||
[''], // Supplied by createOptions
|
||||
[stdout, stderr],
|
||||
createOptions,
|
||||
(err, data) => {
|
||||
@ -198,9 +198,12 @@ export const createPocketbaseService = async (
|
||||
dbg(`${slug} closed with code ${StatusCode}`, { err, data })
|
||||
isRunning = false
|
||||
if (StatusCode > 0) {
|
||||
dbg(`${slug} stopped unexpectedly with code ${err}`, data)
|
||||
onUnexpectedStop?.(StatusCode, stdoutHistory, stderrHistory)
|
||||
if (err?.json) {
|
||||
error(`Error: ${err.json.message}`)
|
||||
dbg(`${slug} stopped unexpectedly with code ${err}`, data)
|
||||
}
|
||||
}
|
||||
onUnexpectedStop?.(StatusCode, stdoutHistory, stderrHistory)
|
||||
resolveExit(0)
|
||||
},
|
||||
)
|
||||
@ -211,7 +214,9 @@ export const createPocketbaseService = async (
|
||||
})
|
||||
cm.add(async () => {
|
||||
dbg(`Stopping ${slug} for cleanup`)
|
||||
await container?.stop().catch(warn)
|
||||
await container
|
||||
?.stop()
|
||||
.catch((err) => warn(`Possible error stopping container: ${err}`))
|
||||
stderr.off('data', _stdErrData)
|
||||
stdout.off('data', _stdoutData)
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user