mirror of
https://github.com/morluto/rea.git
synced 2026-11-12 01:41:21 +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,4 @@
|
||||
import { ProcessAdmissionError } from "./ProcessAdmissionError.js";
|
||||
import { readFile, stat as statPath } from "node:fs/promises";
|
||||
import { performance } from "node:perf_hooks";
|
||||
import { setTimeout as delay } from "node:timers/promises";
|
||||
@@ -1348,9 +1349,9 @@ export const createSystemProcessOwnershipHost = (
|
||||
liveAfterRetry.some((entry) => entry.pid === pid),
|
||||
);
|
||||
if (stillUnresolved.length > 0)
|
||||
throw new Error(
|
||||
`process identity snapshot is unavailable for ${String(stillUnresolved.length)} live processes`,
|
||||
);
|
||||
throw new ProcessAdmissionError("identity_snapshot_unavailable", {
|
||||
live_processes: stillUnresolved.length,
|
||||
});
|
||||
}
|
||||
return processes.map(({ pid }) => {
|
||||
const observation = identities.get(pid);
|
||||
@@ -1369,7 +1370,7 @@ export const createSystemProcessOwnershipHost = (
|
||||
try {
|
||||
const processes = await listProcesses(signal);
|
||||
if (!processes.some(({ pid }) => pid === process.pid))
|
||||
throw new Error("ps did not report REA's current process");
|
||||
throw new ProcessAdmissionError("current_process_unreported");
|
||||
} catch (cause: unknown) {
|
||||
if (isExpectedAbort(cause, signal)) throw cause;
|
||||
throw new LinuxOwnedProcessPrerequisiteError(cause);
|
||||
|
||||
Reference in new issue
Block a user