UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

50 lines (49 loc) • 2.82 kB
import { W as resolveGlobalSingleton } from "./path-guards-quCEQx1i.mjs"; //#region src/infra/gateway-state-owner-errors.ts const GATEWAY_STATE_PROCESS_OWNER_RETIRED_MESSAGE = "OpenClaw state process owner is no longer current"; /** * This process released or replaced its state owner, e.g. while an in-process * restart hands state from the closing iteration to the next one. A plain Error * keeps the message identical across worker replies and logs. */ function createGatewayStateProcessOwnerRetiredError() { return /* @__PURE__ */ new Error(GATEWAY_STATE_PROCESS_OWNER_RETIRED_MESSAGE); } var StateDatabaseAccessError = class extends Error { constructor(...e) { super(...e); this.name = "StateDatabaseAccessError"; } }; const GatewayStateOwnerContentionError = resolveGlobalSingleton(Symbol.for("openclaw.gatewayStateOwnerContentionError"), () => class StateOwnerContentionError extends Error { constructor(e, t, n, r) { super(`OpenClaw state database is busy at ${e}. ${n ? `${n} ` : ""}Wait for the other OpenClaw process to finish, then retry. If it persists, run \`openclaw gateway status\` and check for other OpenClaw processes using the same state directory. A running Gateway can hold this ownership until it stops; stop it through its service manager or original terminal before retrying.`); this.databasePath = e; this.cause = t; this.holderDetail = n; this.holder = r; this.name = "GatewayStateOwnerContentionError"; } }); /** A local holder exists, but the caller has no live lexical maintenance authority. */ const StateDatabaseMaintenanceScopeError = resolveGlobalSingleton(Symbol.for("openclaw.stateDatabaseMaintenanceScopeError"), () => class extends StateDatabaseAccessError { constructor(e) { super(`Internal state ownership error at ${e}: this process holds maintenance ownership without an active schema lease or maintenance scope. Retry the command; if it persists, report this error.`); this.name = "StateDatabaseMaintenanceScopeError"; } }); const StateDatabaseAdmissionPendingError = resolveGlobalSingleton(Symbol.for("openclaw.stateDatabaseAdmissionPendingError"), () => class extends StateDatabaseAccessError { constructor(e, t) { super(t); this.databasePath = e; } }); /** A live foreign process holds offline-maintenance custody of this database. */ const StateDatabaseOfflineMaintenanceError = resolveGlobalSingleton(Symbol.for("openclaw.stateDatabaseOfflineMaintenanceError"), () => class extends StateDatabaseAccessError { constructor(e, t) { super(t); this.databasePath = e; } }); //#endregion export { StateDatabaseOfflineMaintenanceError as a, StateDatabaseMaintenanceScopeError as i, StateDatabaseAccessError as n, createGatewayStateProcessOwnerRetiredError as o, StateDatabaseAdmissionPendingError as r, GatewayStateOwnerContentionError as t };