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

Function formatUnknownMessage

apps/cli/src/main.ts:1500–1508  ·  view source on GitHub ↗
(cause: unknown)

Source from the content-addressed store, hash-verified

1498 );
1499
1500const formatUnknownMessage = (cause: unknown): string => {
1501 if (cause instanceof Error) return cause.message;
1502 if (typeof cause === "string") return cause;
1503 if (typeof cause === "object" && cause !== null && "message" in cause) {
1504 const message = cause.message;
1505 if (typeof message === "string") return message;
1506 }
1507 return String(cause);
1508};
1509
1510const readCliLogLevel = (argv: ReadonlyArray<string>): string | undefined => {
1511 for (let index = 0; index < argv.length; index += 1) {

Callers 1

renderCliErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected