MCPcopy Create free account
hub / github.com/cryptocj520/meteora2 / parseErrorResponse

Method parseErrorResponse

web/public/js/api.js:216–226  ·  view source on GitHub ↗

* 解析错误响应

(response)

Source from the content-addressed store, hash-verified

214 * 解析错误响应
215 */
216 async parseErrorResponse(response) {
217 try {
218 const contentType = response.headers.get('content-type');
219 if (contentType && contentType.includes('application/json')) {
220 return await response.json();
221 }
222 return { message: await response.text() };
223 } catch {
224 return { message: `HTTP ${response.status} ${response.statusText}` };
225 }
226 }
227
228 /**
229 * 处理API错误

Callers 1

executeRequestMethod · 0.95

Calls 1

getMethod · 0.65

Tested by

no test coverage detected