openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
2 lines • 716 B
JavaScript
//!src/infra/agent-lifecycle-error.ts
const AGENT_RUN_STALE_LIFECYCLE_ERROR=`Agent run belongs to a stale gateway lifecycle`;const AGENT_RUN_STALE_LIFECYCLE_ERROR_CODE=`ERR_STALE_GATEWAY_LIFECYCLE`;function createAgentRunStaleLifecycleError(){return Object.assign(/* @__PURE__ */ new Error(AGENT_RUN_STALE_LIFECYCLE_ERROR),{name:`AbortError`,code:AGENT_RUN_STALE_LIFECYCLE_ERROR_CODE})}function hasLifecycleErrorCode(e,t){try{return e instanceof Error&&`code`in e&&e.code===t}catch{return false}}function isAgentRunStaleLifecycleError(e){return hasLifecycleErrorCode(e,AGENT_RUN_STALE_LIFECYCLE_ERROR_CODE)}export{hasLifecycleErrorCode as n,isAgentRunStaleLifecycleError as r,createAgentRunStaleLifecycleError as t};