UNPKG

auto-builder-sdk

Version:

SDK for building Auto Builder workflow plugins

31 lines (30 loc) 958 B
export class NodeOperationError extends Error { description; context; constructor(node, error, options = {}) { super(); this.name = 'NodeOperationError'; this.message = options.message ?? (typeof error === 'string' ? error : error.message); this.description = options.description ?? 'Unknown operation error'; this.context = { runIndex: options.runIndex, itemIndex: options.itemIndex, nodeId: node.id, nodeType: node.type, }; } } export class NodeApiError extends Error { httpStatusCode; errorMessage; description; context; constructor(node, error, options = {}) { super(); this.name = 'NodeApiError'; this.httpStatusCode = options.httpStatusCode; this.errorMessage = options.message ?? 'Unknown API error'; this.description = options.description; this.context = error; } }