MCPcopy Create free account
hub / github.com/dwgx/WindsurfAPI / readErrorDetails

Function readErrorDetails

src/windsurf.js:1352–1362  ·  view source on GitHub ↗
(buf)

Source from the content-addressed store, hash-verified

1350 // Walk CortexErrorDetails. user_error_message, short_error and full_error
1351 // usually contain the same text at increasing verbosity — pick one.
1352 const readErrorDetails = (buf) => {
1353 const ed = parseFields(buf);
1354 for (const fnum of [1, 2, 3]) {
1355 const f = getField(ed, fnum, 2);
1356 if (f) {
1357 const s = f.value.toString('utf8').trim();
1358 if (s) return s.split('\n')[0].slice(0, 300);
1359 }
1360 }
1361 return '';
1362 };
1363
1364 // Error info lives at either CortexTrajectoryStep.error_message (field 24
1365 // for ERROR_MESSAGE steps) or CortexTrajectoryStep.error (field 31 for any

Callers 1

parseTrajectoryStepsFunction · 0.85

Calls 2

parseFieldsFunction · 0.90
getFieldFunction · 0.90

Tested by

no test coverage detected