mirror of
https://github.com/morluto/rea.git
synced 2026-10-30 19:35:56 +00:00
fix(evidence): centralize authentication failure ownership
This commit is contained in:
1 parent
0407bbfbe6
commit
b6a0f32b14
10 files changed
+209
-119
No files matched your search
@@ -3,11 +3,8 @@ import {
|
||||
JAVASCRIPT_RUNTIME_RECONCILIATION_PROVIDER,
|
||||
MANAGED_WORKFLOW_PROVIDER,
|
||||
} from "../InvestigationProviders.js";
|
||||
import {
|
||||
isImmutableEvidence,
|
||||
parseEvidence,
|
||||
type Evidence,
|
||||
} from "../../domain/evidence.js";
|
||||
import { isImmutableEvidence, type Evidence } from "../../domain/evidence.js";
|
||||
import { safeParseEvidence } from "../../domain/evidenceValidation.js";
|
||||
import {
|
||||
type AnalysisInputIssue,
|
||||
AnalysisInputError,
|
||||
@@ -355,12 +352,9 @@ const parseEvidenceInput = (
|
||||
input: unknown,
|
||||
path: readonly (string | number)[],
|
||||
): Evidence => {
|
||||
try {
|
||||
return parseEvidence(input);
|
||||
} catch (cause: unknown) {
|
||||
if (cause instanceof z.ZodError) throw zodInputFailure(cause, input, path);
|
||||
throw cause;
|
||||
}
|
||||
const parsed = safeParseEvidence(input);
|
||||
if (parsed.ok) return parsed.value;
|
||||
throw zodInputFailure(parsed.error, input, path);
|
||||
};
|
||||
|
||||
const parseCallerValue = <Value>(
|
||||
|
||||
Reference in new issue
Block a user