MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / fumaFailureFromCause

Function fumaFailureFromCause

packages/core/sdk/src/fuma-runtime.ts:72–79  ·  view source on GitHub ↗
(label: string, cause: unknown)

Source from the content-addressed store, hash-verified

70 Predicate.isTagged(error, "StorageError") || Predicate.isTagged(error, "UniqueViolationError");
71
72export const fumaFailureFromCause = (label: string, cause: unknown): StorageFailure => {
73 if (isStorageFailure(cause)) return cause;
74 if (isUniqueViolation(cause)) return new UniqueViolationError({ model: label });
75 return new StorageError({
76 message: causeMessage(cause) ?? `FumaDB operation failed: ${label}`,
77 cause,
78 });
79};
80
81export const fumaEffect = <A>(
82 label: string,

Callers 2

fumaEffectFunction · 0.85
transactionFunction · 0.85

Calls 3

isStorageFailureFunction · 0.85
isUniqueViolationFunction · 0.85
causeMessageFunction · 0.70

Tested by

no test coverage detected