MCPcopy Index your code
hub / github.com/simstudioai/sim / buildBlockExecutionError

Function buildBlockExecutionError

apps/sim/executor/utils/errors.ts:44–65  ·  view source on GitHub ↗
(details: BlockExecutionErrorDetails)

Source from the content-addressed store, hash-verified

42}
43
44export function buildBlockExecutionError(details: BlockExecutionErrorDetails): Error {
45 const errorMessage =
46 details.error instanceof Error ? details.error.message : String(details.error)
47 const blockName = details.block.metadata?.name || details.block.id
48 const blockType = details.block.metadata?.id || 'unknown'
49
50 const error = new Error(`${blockName}: ${errorMessage}`)
51
52 const innerStatusCode = readStatusCode(details.error)
53
54 Object.assign(error, {
55 blockId: details.block.id,
56 blockName,
57 blockType,
58 workflowId: details.context?.workflowId,
59 timestamp: new Date().toISOString(),
60 ...details.additionalInfo,
61 ...(innerStatusCode !== undefined ? { statusCode: innerStatusCode } : {}),
62 })
63
64 return error
65}
66
67export function buildHTTPError(config: {
68 status: number

Callers 2

executeMethod · 0.90
handleBlockErrorMethod · 0.90

Calls 1

readStatusCodeFunction · 0.85

Tested by

no test coverage detected