Component evidence

Transaction Orchestration Errors (transaction/errors.ts)

medusa · packages/core/orchestration/src/transaction/errors.ts · typescript · MIT
databaseautomationlang:typescripttag:errortag:core

Defines custom error classes used by the transaction orchestration engine to signal permanent failures, skips, and timeouts.

Source preview first 800 characters · full source over MCP
// Source: https://github.com/medusajs/medusa | License: MIT | Copyright 2021 Medusajs
// Provided via justclaw.it.com; keep this notice with the code.
import { OrchestrationUtils } from "@medusajs/utils"

class BaseStepErrror extends Error {
  #stepResponse: unknown

  constructor(name, message?: string, stepResponse?: unknown) {
    super(message)
    this.name = name
    this.#stepResponse = stepResponse
  }

  getStepResponse(): unknown {
    return this.#stepResponse
  }
}

export class PermanentStepFailureError extends BaseStepErrror {
  static isPermanentStepFailureError(
    error: Error
  ): error is PermanentStepFailureError {
    return (
      error instanceof PermanentStepFailureError ||
      error?.name === "PermanentStepFailure"
    )
  }

  constructor(message?: string, st

... (truncated -- full source via MCP)