UNPKG

torotask

Version:

Task queue processing in NodeJS based on BullMQ and Redis

20 lines 951 B
import type { StepResult } from '../types/step.js'; /** * Utility to serialize an error object into a plain object. * Throws UnrecoverableError if: * 1. Serialization fails, as this represents a fundamental state management issue * 2. The serialized error exceeds the maximum allowed size * These are issues that retries won't solve. * * @param error The error to serialize * @param maxSizeBytes Maximum size of serialized error in bytes (defaults to MAX_ERROR_SIZE_BYTES) */ export declare function serializeError(error: any, maxSizeBytes?: number): StepResult['error']; /** * Utility to deserialize a stored error. * For simplicity, it just creates a generic Error. * Throws UnrecoverableError if deserialization fails, as this represents * a fundamental state management issue that retries won't solve. */ export declare function deserializeError(storedError: StepResult['error']): Error; //# sourceMappingURL=serialize-error.d.ts.map