UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

18 lines (17 loc) • 1.35 kB
import { a as extractErrorCode, r as collectErrorGraphCandidates, u as readErrorCauses } from "./error-coercion-hDrHOSGy.mjs"; import { t as formatErrorMessage } from "./errors-BKzCeTYb.mjs"; import { n as formatSqliteErrorCodeSuffix } from "./sqlite-error-diagnostics-6_hREUnq.mjs"; //#region src/infra/gateway-lock-diagnostics.ts /** Keep acquisition failures distinct from contention when Doctor records a refusal. */ function formatGatewayLockFailure(e) { const t = collectErrorGraphCandidates(e, readErrorCauses); const n = new Set(t.map(extractErrorCode)); let r = ""; if (n.has("EACCES") || n.has("EPERM")) r = "Check ownership and write permissions for the reported lock path under the OpenClaw user; containers need a writable state mount."; else if (n.has("ENOSPC")) r = "Free space or inodes on the filesystem containing the reported lock path, then retry."; else if (n.has("ENOSYS")) r = "The required filesystem operation is unavailable. Upgrade OpenClaw and the container host/kernel, then retry."; else if (n.has("ENOTSUP") || n.has("EOPNOTSUPP")) r = "Stop OpenClaw, back up the state directory, and use a local filesystem that supports exclusive file creation for state ownership."; return `${formatErrorMessage(e)}${formatSqliteErrorCodeSuffix(e)}${r ? `. ${r}` : ""}`; } //#endregion export { formatGatewayLockFailure as t };