mirror of
https://github.com/morluto/rea.git
synced 2026-11-15 19:23:24 +00:00
fix: report provider admission failures as typed codes (#8066)
* 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>
This commit is contained in:
1 parent
3b647132c6
commit
317bf3fe23
63 files changed
+1021
-432
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { ProcessAdmissionError } from "./ProcessAdmissionError.js";
|
||||
|
||||
/** Timeout and cancellation projections for one correlated operation. */
|
||||
export type PendingOperationOptions<Value> = {
|
||||
readonly signal?: AbortSignal;
|
||||
@@ -36,7 +38,7 @@ export class PendingOperations<Key, Value> {
|
||||
/** Register one unique operation key and await its reply or cancellation. */
|
||||
wait(key: Key, options: PendingOperationOptions<Value>): Promise<Value> {
|
||||
if (this.#pending.has(key))
|
||||
throw new Error("Pending operation key is already registered");
|
||||
throw new ProcessAdmissionError("duplicate_key");
|
||||
if (options.signal?.aborted === true)
|
||||
return Promise.resolve(options.cancelledValue());
|
||||
|
||||
|
||||
Reference in new issue
Block a user