Download src/cron/store/save-error.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 923 Bytes
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/cron/store/save-error.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/cron/store/save-error.ts
-
curl -L -o save-error.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/cron/store/save-error.ts
923 Bytes
| import { restoreCronLoadError, serializeCronLoadError } from "./load-error.js"; | |
| export class CronJobsStoreChangedError extends Error { | |
| constructor(storePath: string) { | |
| super(`Cron store at ${storePath} changed after it was read; reload it before writing`); | |
| this.name = "CronJobsStoreChangedError"; | |
| } | |
| } | |
| export type CronSaveError = | |
| | { kind: "store-changed"; storePath: string } | |
| | { kind: "other"; error: ReturnType<typeof serializeCronLoadError> }; | |
| export function serializeCronSaveError(error: unknown, storePath: string): CronSaveError { | |
| return error instanceof CronJobsStoreChangedError | |
| ? { kind: "store-changed", storePath } | |
| : { kind: "other", error: serializeCronLoadError(error) }; | |
| } | |
| export function restoreCronSaveError(error: CronSaveError): Error { | |
| return error.kind === "store-changed" | |
| ? new CronJobsStoreChangedError(error.storePath) | |
| : restoreCronLoadError(error.error); | |
| } | |