Skip to content

Commit

Permalink
chore(workflows-sdk): Display each error individually instead of pack…
Browse files Browse the repository at this point in the history
…ed (#10072)

**What**
Instead of displaying a single string prepared with all the errors, log each error individually
  • Loading branch information
adrien2p authored Nov 15, 2024
1 parent dea86d8 commit 10da8b3
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions packages/core/workflows-sdk/src/helper/workflow-export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,21 +519,14 @@ function attachOnFinishReleaseEvents(
) || console

if (logOnError) {
const TERMINAL_SIZE = process.stdout?.columns ?? 60
const separator = new Array(TERMINAL_SIZE).join("-")

const workflowName = transaction.getFlow().modelId
const allWorkflowErrors = transaction
transaction
.getErrors()
.map(
(err) =>
.forEach((err) =>
logger.error(
`${workflowName}:${err?.action}:${err?.handlerType} - ${err?.error?.message}${EOL}${err?.error?.stack}`
)
)
.join(EOL + separator + EOL)

if (allWorkflowErrors) {
logger.error(allWorkflowErrors)
}
}

await onFinish?.(args)
Expand Down

0 comments on commit 10da8b3

Please sign in to comment.