Skip to content

Commit

Permalink
feat: improve error logs
Browse files Browse the repository at this point in the history
  • Loading branch information
subframe7536 committed Dec 19, 2024
1 parent 5992b92 commit 6bb593e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,13 @@ export async function runAndRestart(message: string, fullRestart: boolean, actio
}

function logError(message: string, error: unknown) {
log.error(message, ...error instanceof Error ? [error.message, error.stack] : [error])
showMessage(`${message}, Error: ${error}`)
if (error instanceof Error) {
log.error(message, error instanceof Error ? `${error.message},` : error)
showMessage(`${message}, ${error}`)
} else {
log.error(message, error)
showMessage(`${message}, Error: ${error}`)
}
}

export async function showMessage<T extends string[]>(
Expand Down

0 comments on commit 6bb593e

Please sign in to comment.