Skip to content

Commit

Permalink
perf: tweak up error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Feb 20, 2022
1 parent cf0d884 commit 88ccb5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/main/ts/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ export const runSync = (_flags: TFlags = {}, _flow?: TFlow): void => {

try {
exec(flow.main, ctx)
} catch (err) {
} catch (err: any) {
ctx.err = err

!flags.silent && console.error((err.error || err.status || err)?.toString())
exec(flow.fallback, ctx)

throw err
Expand Down
4 changes: 1 addition & 3 deletions src/main/ts/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ export const invoke = (
? ['inherit', 'inherit', 'inherit']
: [null, null, null] // eslint-disable-line
const result = cp.spawnSync(cmd, args, { cwd, stdio })
const err = result.error || result.status

if (!skipError && err) {
!silent && console.error(chalk.bold('err'), err?.toString().trim())
if (!skipError && (result.error || result.status)) {
throw result
}

Expand Down

0 comments on commit 88ccb5d

Please sign in to comment.