MCPcopy
hub / github.com/callstack/agent-device / toAppErrorCode

Function toAppErrorCode

src/kernel/errors.ts:25–31  ·  view source on GitHub ↗
(
  code: string | undefined,
  fallback: AppErrorCode = 'COMMAND_FAILED',
)

Source from the content-addressed store, hash-verified

23export type AppErrorCode = KnownAppErrorCode | (string & {});
24
25export function toAppErrorCode(
26 code: string | undefined,
27 fallback: AppErrorCode = 'COMMAND_FAILED',
28): AppErrorCode {
29 if (typeof code === 'string' && code.length > 0) return code;
30 return fallback;
31}
32
33type AppErrorDetails = Record<string, unknown> & {
34 hint?: string;

Callers 11

throwDaemonErrorFunction · 0.90
handleWorkerMessageFunction · 0.90
errors.test.tsFile · 0.90
finalizeDaemonResponseFunction · 0.90
toDaemonHttpRpcErrorFunction · 0.90
runHttpAuthHookFunction · 0.90
buildSequenceStepErrorFunction · 0.90
runnerStatusFailureErrorFunction · 0.90
parseRunnerResponseFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected