MCPcopy Create free account
hub / github.com/langgenius/dify / parseServerError

Function parseServerError

cli/src/http/error-mapper.ts:65–77  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

63}
64
65function parseServerError(raw: string): ErrorBody | undefined {
66 if (raw === '')
67 return undefined
68 let parsed: unknown
69 try {
70 parsed = JSON.parse(raw)
71 }
72 catch {
73 return undefined
74 }
75 const result = zErrorBody.safeParse(parsed)
76 return result.success ? result.data : undefined
77}
78
79export async function classifyResponse(request: Request, response: Response): Promise<HttpClientError> {
80 let raw = ''

Callers 1

classifyResponseFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected