fix: format error log (#2184)
This commit is contained in:
@@ -68,6 +68,7 @@ export namespace Format {
|
|||||||
|
|
||||||
for (const item of await getFormatter(ext)) {
|
for (const item of await getFormatter(ext)) {
|
||||||
log.info("running", { command: item.command })
|
log.info("running", { command: item.command })
|
||||||
|
try {
|
||||||
const proc = Bun.spawn({
|
const proc = Bun.spawn({
|
||||||
cmd: item.command.map((x) => x.replace("$FILE", file)),
|
cmd: item.command.map((x) => x.replace("$FILE", file)),
|
||||||
cwd: App.info().path.cwd,
|
cwd: App.info().path.cwd,
|
||||||
@@ -81,6 +82,15 @@ export namespace Format {
|
|||||||
command: item.command,
|
command: item.command,
|
||||||
...item.environment,
|
...item.environment,
|
||||||
})
|
})
|
||||||
|
} catch (error) {
|
||||||
|
log.error("failed", {
|
||||||
|
error,
|
||||||
|
command: item.command,
|
||||||
|
...item.environment,
|
||||||
|
})
|
||||||
|
// re-raising
|
||||||
|
throw error
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user