@mondaydotcomorg/atp-compiler
Version:
Production-ready compiler for transforming async iteration patterns into resumable operations with checkpoint-based state management
61 lines • 2.11 kB
JavaScript
export var CheckpointOperation;
(function (CheckpointOperation) {
CheckpointOperation["SAVE"] = "save";
CheckpointOperation["LOAD"] = "load";
CheckpointOperation["CLEAR"] = "clear";
})(CheckpointOperation || (CheckpointOperation = {}));
export class BatchPauseExecutionError extends Error {
calls;
batchId;
sequenceNumber;
constructor(calls, batchId, sequenceNumber) {
super(`Batch pause for parallel execution (${calls.length} callbacks)`);
this.name = 'BatchPauseExecutionError';
this.calls = calls;
this.batchId = batchId;
this.sequenceNumber = sequenceNumber;
}
}
export class CheckpointError extends Error {
checkpointId;
operation;
constructor(message, checkpointId, operation) {
super(`Checkpoint ${operation} failed for ${checkpointId}: ${message}`);
this.name = 'CheckpointError';
this.checkpointId = checkpointId;
this.operation = operation;
}
}
export class TransformationError extends Error {
code;
pattern;
location;
constructor(message, code, pattern, location) {
const loc = location ? ` at line ${location.line}:${location.column}` : '';
super(`Transformation failed for ${pattern}${loc}: ${message}`);
this.name = 'TransformationError';
this.code = code;
this.pattern = pattern;
this.location = location;
}
}
export class InfiniteLoopDetectionError extends Error {
loopId;
iterationCount;
constructor(loopId, iterationCount) {
super(`Infinite loop detected: ${loopId} exceeded ${iterationCount} iterations without completing`);
this.name = 'InfiniteLoopDetectionError';
this.loopId = loopId;
this.iterationCount = iterationCount;
}
}
export function isBatchPauseError(error) {
return error instanceof BatchPauseExecutionError;
}
export function isCheckpointError(error) {
return error instanceof CheckpointError;
}
export function isTransformationError(error) {
return error instanceof TransformationError;
}
//# sourceMappingURL=errors.js.map