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

Function causeMessage

packages/core/sdk/src/fuma-runtime.ts:60–67  ·  view source on GitHub ↗
(cause: unknown)

Source from the content-addressed store, hash-verified

58};
59
60const causeMessage = (cause: unknown): string | undefined => {
61 const message =
62 cause && typeof cause === "object"
63 ? // oxlint-disable-next-line executor/no-unknown-error-message -- boundary: preserve database driver error text inside typed StorageError
64 (cause as Record<string, unknown>)["message"]
65 : undefined;
66 return typeof message === "string" && message.length > 0 ? message : undefined;
67};
68
69export const isStorageFailure = (error: unknown): error is StorageFailure =>
70 Predicate.isTagged(error, "StorageError") || Predicate.isTagged(error, "UniqueViolationError");

Callers 1

fumaFailureFromCauseFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected