MCPcopy
hub / github.com/continuedev/continue / logResponse

Function logResponse

packages/fetch/src/fetch.ts:56–74  ·  view source on GitHub ↗
(resp: Response)

Source from the content-addressed store, hash-verified

54}
55
56async function logResponse(resp: Response) {
57 console.log("=== FETCH RESPONSE ===");
58 console.log(`Status: ${resp.status} ${resp.statusText}`);
59 console.log("Response Headers:");
60 resp.headers.forEach((value, key) => {
61 console.log(` ${key}: ${value}`);
62 });
63
64 // TODO: For streamed responses, this caused the response to be consumed and the connection would just hang open
65 // Clone response to read body without consuming it
66 // const respClone = resp.clone();
67 // try {
68 // const responseText = await respClone.text();
69 // console.log(`Response Body: ${responseText}`);
70 // } catch (e) {
71 // console.log("Could not read response body:", e);
72 // }
73 console.log("======================");
74}
75
76function logError(error: unknown) {
77 console.log("=== FETCH ERROR ===");

Callers 1

fetchwithRequestOptionsFunction · 0.85

Calls 1

logMethod · 0.65

Tested by

no test coverage detected