MCPcopy Create free account
hub / github.com/cloudflare/computer / recordError

Function recordError

packages/computer/src/observe.ts:193–198  ·  view source on GitHub ↗

* Records `error.message` and `error.name` on `span`. Messages are * bounded and common credential forms are redacted. Adapters that * want richer error reporting can subscribe to the underlying span * system directly; the workspace itself only forwards what the * Cloudflare `Span` surface accep

(span: WorkspaceSpan, error: unknown)

Source from the content-addressed store, hash-verified

191 * Cloudflare `Span` surface accepts.
192 */
193function recordError(span: WorkspaceSpan, error: unknown): void {
194 if (error instanceof Error) {
195 span.setAttribute("error.name", error.name);
196 }
197 span.setAttribute("error.message", safeErrorMessage(error));
198}
199
200const MAX_SAFE_ERROR_LENGTH = 512;
201

Callers 1

withSpanFunction · 0.85

Calls 2

safeErrorMessageFunction · 0.85
setAttributeMethod · 0.65

Tested by

no test coverage detected