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

Function createResourceErrorResponse

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

Source from the content-addressed store, hash-verified

95 * Create a resource error response object
96 */
97export function createResourceErrorResponse(
98 uri: string,
99 error: string,
100 code: string = "ERROR",
101 details?: any
102) {
103 return {
104 contents: [
105 {
106 uri,
107 text: JSON.stringify(formatErrorResponse(error, code, details), bigIntReplacer, 2),
108 mimeType: "application/json",
109 },
110 ],
111 };
112}
113
114/**
115 * Create a resource success response object

Callers

nothing calls this directly

Calls 1

formatErrorResponseFunction · 0.85

Tested by

no test coverage detected