MCPcopy Index your code
hub / github.com/simstudioai/sim / onRefFailure

Function onRefFailure

apps/sim/lib/logs/execution/pii-large-values.ts:150–162  ·  view source on GitHub ↗

Rethrow (as PiiRedactionError) or scrub-to-marker, per `onFailure`.

(
  error: unknown,
  options: RedactLargeValueRefsOptions,
  context: string
)

Source from the content-addressed store, hash-verified

148
149/** Rethrow (as {@link PiiRedactionError}) or scrub-to-marker, per `onFailure`. */
150function onRefFailure(
151 error: unknown,
152 options: RedactLargeValueRefsOptions,
153 context: string
154): never | string {
155 if ((options.onFailure ?? 'scrub') === 'throw') {
156 throw error instanceof PiiRedactionError
157 ? error
158 : new PiiRedactionError(`${context}: ${getErrorMessage(error)}`)
159 }
160 logger.error(`${context}; scrubbing`, { error: getErrorMessage(error) })
161 return REDACTION_FAILED_MARKER
162}
163
164async function redactRef(
165 ref: LargeValueRef,

Callers 2

redactRefFunction · 0.85
redactManifestFunction · 0.85

Calls 2

getErrorMessageFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected