MCPcopy Create free account
hub / github.com/continuedev/continue / parseErrorMessage

Function parseErrorMessage

gui/src/util/errorAnalysis.ts:14–36  ·  view source on GitHub ↗
(fullErrMsg: string)

Source from the content-addressed store, hash-verified

12}
13
14function parseErrorMessage(fullErrMsg: string): string {
15 if (
16 !fullErrMsg ||
17 typeof fullErrMsg !== "string" ||
18 !fullErrMsg.includes("\n\n")
19 ) {
20 return fullErrMsg;
21 }
22
23 const msg = fullErrMsg.split("\n\n").slice(1).join("\n\n");
24 try {
25 const parsed = JSON.parse(msg);
26 if (parsed.error !== undefined && parsed.error !== null) {
27 return JSON.stringify(parsed.error);
28 }
29 if (parsed.message !== undefined && parsed.message !== null) {
30 return JSON.stringify(parsed.message);
31 }
32 return msg;
33 } catch (e) {
34 return msg;
35 }
36}
37
38export function analyzeError(
39 error: unknown,

Callers 1

analyzeErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected