@hotmeshio/hotmesh
Version:
Permanent-Memory Workflows & AI Agents
29 lines (28 loc) • 824 B
TypeScript
/**
* Checks if an error is a HotMesh reserved error type that indicates
* a HotMesh interruption rather than a true error condition.
*
* When this returns true, you can safely return rethrow the error.
* The workflow engine will handle the interruption automatically.
*
* @example
* ```typescript
* import { MemFlow } from '@hotmeshio/hotmesh';
*
* try {
* await someWorkflowOperation();
* } catch (error) {
* // Check if this is a HotMesh interruption
* if (MemFlow.workflow.didInterrupt(error)) {
* // Rethrow the error
* throw error;
* }
* // Handle actual error
* console.error('Workflow failed:', error);
* }
* ```
*
* @param error - The error to check
* @returns true if the error is a HotMesh interruption
*/
export declare function didInterrupt(error: Error): boolean;