feat(workflows-sdk): log on error (#8666)

This commit is contained in:
Carlos R. L. Rodrigues
2024-08-20 06:23:24 -03:00
committed by GitHub
parent 1be9373290
commit eb0bfe9f33
6 changed files with 122 additions and 80 deletions

View File

@@ -1,7 +1,7 @@
import {
DistributedTransaction,
DistributedTransactionType,
DistributedTransactionEvents,
DistributedTransactionType,
TransactionHandlerType,
TransactionStep,
WorkflowScheduler,
@@ -12,12 +12,12 @@ import {
Logger,
MedusaContainer,
} from "@medusajs/types"
import { InjectSharedContext, isString, MedusaContext } from "@medusajs/utils"
import { InjectSharedContext, MedusaContext, isString } from "@medusajs/utils"
import {
FlowRunOptions,
MedusaWorkflow,
resolveValue,
ReturnWorkflow,
resolveValue,
} from "@medusajs/workflows-sdk"
import Redis from "ioredis"
import { ulid } from "ulid"
@@ -158,6 +158,7 @@ export class WorkflowOrchestratorService {
transactionId,
resultFrom,
throwOnError,
logOnError,
events: eventHandlers,
container,
} = options ?? {}
@@ -191,6 +192,7 @@ export class WorkflowOrchestratorService {
const ret = await flow.run({
input,
throwOnError,
logOnError,
resultFrom,
context,
events,
@@ -266,6 +268,7 @@ export class WorkflowOrchestratorService {
const {
context,
throwOnError,
logOnError,
resultFrom,
container,
events: eventHandlers,
@@ -294,6 +297,7 @@ export class WorkflowOrchestratorService {
context,
resultFrom,
throwOnError,
logOnError,
events,
response: stepResponse,
})
@@ -328,6 +332,7 @@ export class WorkflowOrchestratorService {
const {
context,
throwOnError,
logOnError,
resultFrom,
container,
events: eventHandlers,
@@ -356,6 +361,7 @@ export class WorkflowOrchestratorService {
context,
resultFrom,
throwOnError,
logOnError,
events,
response: stepResponse,
})