mirror of
https://github.com/morluto/rea.git
synced 2026-11-11 01:13:39 +00:00
* fix: report provider admission failures as typed codes * fix(evm): keep limiter path on admission diagnostics * fix: assert WABT and CBOR admission codes * fix: keep admission details on returned failures * fix(evm): detect repeated CBOR keys in the decoder --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
32 lines
826 B
TypeScript
32 lines
826 B
TypeScript
const EVM_ADMISSION_CODES = [
|
|
"prlimit_not_absolute",
|
|
"prlimit_not_file",
|
|
"cleanup_incomplete",
|
|
"cleanup_unconfirmed",
|
|
"marker_mismatch",
|
|
"request_path_missing",
|
|
"tag_or_float",
|
|
"text_bytes_unavailable",
|
|
"collection_exceeds_bound",
|
|
"nesting_exceeds_profile",
|
|
"value_outside_profile",
|
|
"repeated_map_key",
|
|
"root_not_map",
|
|
] as const;
|
|
|
|
export type EvmAdmissionCode = (typeof EVM_ADMISSION_CODES)[number];
|
|
|
|
/** EVM limiter, worker, or metadata admission failure. `code` is the stable identity. */
|
|
export class EvmAdmissionError extends Error {
|
|
readonly _tag = "EvmAdmissionError";
|
|
|
|
constructor(
|
|
readonly code: EvmAdmissionCode,
|
|
readonly detail?: Readonly<Record<string, string | number>>,
|
|
options?: ErrorOptions,
|
|
) {
|
|
super(code, options);
|
|
this.name = "EvmAdmissionError";
|
|
}
|
|
}
|