fix: daemon pbservice unexpected exit fix

This commit is contained in:
Ben Allfree 2023-10-11 06:28:15 -07:00
parent 9418d899e0
commit 64ed150bd6

View File

@ -197,13 +197,13 @@ export const createPocketbaseService = async (
const { StatusCode } = data || {}
dbg(`${slug} closed with code ${StatusCode}`, { err, data })
isRunning = false
if (StatusCode > 0) {
if (StatusCode > 0 || err) {
if (err?.json) {
error(`Error: ${err.json.message}`)
dbg(`${slug} stopped unexpectedly with code ${err}`, data)
}
onUnexpectedStop?.(StatusCode, stdoutHistory, stderrHistory)
}
onUnexpectedStop?.(StatusCode, stdoutHistory, stderrHistory)
resolveExit(0)
},
)