Download packages/agent-core-v2/src/state/errors.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 1.31 kB
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/state/errors.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/agent-core-v2/src/state/errors.ts
-
curl -L -o errors.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/state/errors.ts
1.31 kB
| import { registerErrorDomain, type ErrorDomain } from '#/_base/errors/codes'; | |
| import { Error2, type Error2Options } from '#/_base/errors/errors'; | |
| export const StateErrors = { | |
| codes: { | |
| STATE_DUPLICATE_FOLD: 'state.duplicate_fold', | |
| STATE_DURABILITY_MISMATCH: 'state.durability_mismatch', | |
| STATE_CYCLE: 'state.cycle', | |
| }, | |
| info: { | |
| 'state.duplicate_fold': { | |
| title: 'Duplicate state fold', | |
| retryable: false, | |
| public: true, | |
| action: 'A state registered two folds for the same event; merge them.', | |
| }, | |
| 'state.durability_mismatch': { | |
| title: 'Transient state folds durable event', | |
| retryable: false, | |
| public: true, | |
| action: 'A non-durable state cannot fold a durable event; mark the state durable.', | |
| }, | |
| 'state.cycle': { | |
| title: 'Event dispatch cycle', | |
| retryable: false, | |
| public: true, | |
| action: 'A subscriber re-dispatches endlessly; break the event cycle.', | |
| }, | |
| }, | |
| } as const satisfies ErrorDomain; | |
| registerErrorDomain(StateErrors); | |
| export type StateErrorCode = (typeof StateErrors.codes)[keyof typeof StateErrors.codes]; | |
| export class StateError extends Error2 { | |
| constructor(code: StateErrorCode, message: string, options?: Error2Options) { | |
| super(code, message, options); | |
| this.name = 'StateError'; | |
| } | |
| } | |