MCPcopy Create free account
hub / github.com/tiann/hapi / rpcError

Function rpcError

cli/src/modules/common/rpcResponses.ts:5–16  ·  view source on GitHub ↗
(
    message: string,
    extras?: T
)

Source from the content-addressed store, hash-verified

3export type RpcSuccessResponse<T extends object> = { success: true } & T
4
5export function rpcError<T extends Record<string, unknown> = Record<string, unknown>>(
6 message: string,
7 extras?: T
8): RpcErrorResponse & T {
9 const payload = {
10 success: false,
11 error: message,
12 ...(extras ?? {})
13 }
14
15 return payload as RpcErrorResponse & T
16}
17
18export function getErrorMessage(error: unknown, fallback: string): string {
19 if (error instanceof Error && error.message) {

Callers 13

registerSkillsHandlersFunction · 0.90
runGitCommandFunction · 0.90
registerGitHandlersFunction · 0.90
registerFileHandlersFunction · 0.90
registerUploadHandlersFunction · 0.90
registerBashHandlersFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected