MCPcopy Create free account
hub / github.com/bytebase/dbhub / formatErrorResponse

Function formatErrorResponse

src/utils/response-formatter.ts:45–61  ·  view source on GitHub ↗
(
  error: string,
  code: string = "ERROR",
  details?: any
)

Source from the content-addressed store, hash-verified

43 * Create an error response with the given message and code
44 */
45export function formatErrorResponse(
46 error: string,
47 code: string = "ERROR",
48 details?: any
49): {
50 success: false;
51 error: string;
52 code: string;
53 details?: any;
54} {
55 return {
56 success: false,
57 error,
58 code,
59 ...(details ? { details } : {}),
60 };
61}
62
63/**
64 * Create a tool error response object

Callers 2

createToolErrorResponseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected