openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
24 lines (23 loc) • 970 B
JavaScript
import { n as hydrateOpenClawStateWorkerError, r as retainOpenClawStateWorkerErrorPayload, t as encodeOpenClawStateWorkerError } from "./openclaw-state-worker-error-C8y1JGQN.mjs";
//#region src/cron/store/load-error.ts
function serializeCronLoadError(e) {
const t = e instanceof Error ? e : new Error(String(e));
const n = "code" in t ? t.code : void 0;
const r = encodeOpenClawStateWorkerError(t, { includeOrdinary: true });
return {
name: t.name,
message: t.message,
...typeof n === "string" || typeof n === "number" ? { code: n } : {},
...r ? { sharedState: r } : {}
};
}
function restoreCronLoadError(e) {
const t = Object.assign(new Error(e.message), {
name: e.name,
...e.code === void 0 ? {} : { code: e.code }
});
if (e.sharedState) retainOpenClawStateWorkerErrorPayload(t, e.sharedState);
return hydrateOpenClawStateWorkerError(t, { includeOrdinary: true });
}
//#endregion
export { serializeCronLoadError as n, restoreCronLoadError as t };