MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / error

Function error

dashboard/build.shared.mjs:170–187  ·  view source on GitHub ↗
(err, _req, res)

Source from the content-addressed store, hash-verified

168 // upgrade/websocket failures, so handle both shapes.
169 on: {
170 error(err, _req, res) {
171 console.error(
172 `tracedecay dev /api proxy error -> ${apiTarget}: ${err.message}`,
173 );
174 if (res && typeof res.writeHead === "function") {
175 if (!res.headersSent) {
176 res.writeHead(502, { "Content-Type": "application/json" });
177 res.end(
178 JSON.stringify({
179 error: `dev proxy failed to reach ${apiTarget}`,
180 detail: err.message,
181 }),
182 );
183 }
184 } else if (res && typeof res.destroy === "function") {
185 res.destroy(err);
186 }
187 },
188 },
189 },
190 },

Calls 1

errorMethod · 0.45

Tested by 3

test_error_responseFunction · 0.68