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

Function mapError

packages/computer/src/artifacts/cli.ts:715–721  ·  view source on GitHub ↗

* Map a thrown error to the standard `artifacts : * ` framing at exit 1. ArtifactError subclasses carry a * clean message; anything else stringifies its cause.

(subcommand: string, cause: unknown)

Source from the content-addressed store, hash-verified

713 * clean message; anything else stringifies its cause.
714 */
715function mapError(subcommand: string, cause: unknown): ArtifactsCLIResult {
716 if (cause instanceof ArtifactError) {
717 return { stdout: "", stderr: `artifacts ${subcommand}: ${cause.message}\n`, exitCode: 1 };
718 }
719 const message = cause instanceof Error ? cause.message : String(cause);
720 return { stdout: "", stderr: `artifacts ${subcommand}: ${message}\n`, exitCode: 1 };
721}
722
723// ---------------------------------------------------------------
724// flag parser

Callers 11

runCreateFunction · 0.85
runShareFunction · 0.85
runRepoCreateFunction · 0.85
runRepoGetFunction · 0.85
runRepoListFunction · 0.85
runRepoDeleteFunction · 0.85
runRepoImportFunction · 0.85
runTokenCreateFunction · 0.85
runTokenListFunction · 0.85
runTokenGetFunction · 0.85
runTokenDeleteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected