mirror of
https://github.com/pockethost/pockethost.git
synced 2025-07-07 05:12: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
|
docker
|
||||||
.run(
|
.run(
|
||||||
`pockethost/pocketbase`,
|
`pockethost/pocketbase`,
|
||||||
[bin, `--help`],
|
[''], // Supplied by createOptions
|
||||||
[stdout, stderr],
|
[stdout, stderr],
|
||||||
createOptions,
|
createOptions,
|
||||||
(err, data) => {
|
(err, data) => {
|
||||||
@ -198,9 +198,12 @@ export const createPocketbaseService = async (
|
|||||||
dbg(`${slug} closed with code ${StatusCode}`, { err, data })
|
dbg(`${slug} closed with code ${StatusCode}`, { err, data })
|
||||||
isRunning = false
|
isRunning = false
|
||||||
if (StatusCode > 0) {
|
if (StatusCode > 0) {
|
||||||
dbg(`${slug} stopped unexpectedly with code ${err}`, data)
|
if (err?.json) {
|
||||||
onUnexpectedStop?.(StatusCode, stdoutHistory, stderrHistory)
|
error(`Error: ${err.json.message}`)
|
||||||
|
dbg(`${slug} stopped unexpectedly with code ${err}`, data)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
onUnexpectedStop?.(StatusCode, stdoutHistory, stderrHistory)
|
||||||
resolveExit(0)
|
resolveExit(0)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@ -211,7 +214,9 @@ export const createPocketbaseService = async (
|
|||||||
})
|
})
|
||||||
cm.add(async () => {
|
cm.add(async () => {
|
||||||
dbg(`Stopping ${slug} for cleanup`)
|
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)
|
stderr.off('data', _stdErrData)
|
||||||
stdout.off('data', _stdoutData)
|
stdout.off('data', _stdoutData)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user