{"record":{"id":"68d9f529c2d2155c","repo":"bytedance/deer-flow","slug":"unknown-error","errorCode":null,"errorMessage":"Unknown error","messagePattern":"Unknown error","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"skills/public/chart-visualization/scripts/generate.js","lineNumber":73,"sourceCode":"    const text = await response.text();\n    throw new Error(`HTTP ${response.status}: ${text}`);\n  }\n\n  return response.json();\n}\n\nasync function generateChartUrl(chartType, options) {\n  const url = getVisRequestServer();\n  const payload = {\n    type: chartType,\n    source: \"chart-visualization-creator\",\n    ...options,\n  };\n\n  const data = await httpPost(url, payload);\n\n  if (!data.success) {\n    throw new Error(data.errorMessage || \"Unknown error\");\n  }\n\n  return data.resultObj;\n}\n\nasync function generateMap(tool, inputData) {\n  const url = getVisRequestServer();\n  const payload = {\n    serviceId: getServiceIdentifier(),\n    tool,\n    input: inputData,\n    source: \"chart-visualization-creator\",\n  };\n\n  const data = await httpPost(url, payload);\n\n  if (!data.success) {\n    throw new Error(data.errorMessage || \"Unknown error\");","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/skills/public/chart-visualization/scripts/generate.js#L55-L91","documentation":"After httpPost succeeds at the HTTP level, generateChartUrl checks the chart service's application-level flag: a body of the shape {success: false, errorMessage} throws with errorMessage, and 'Unknown error' is the fallback when the service reports failure without an errorMessage field.","triggerScenarios":"The chart service returns 200 with success=false and no errorMessage — e.g. an unrecognized chart 'type', malformed option fields, or an internal service error that bypasses its error serializer. Map/vis service quota exhaustion can also return success=false.","commonSituations":"LLM-generated chart spec uses an unsupported type value or invalid option names; the hosted service silently degrades; version skew between the skill's payload format and the service.","solutions":["Log the full response body (not just errorMessage) to see why the service set success=false.","Validate chartType against the service's supported types before calling; fix the spec generator's prompt/template if it emits bad types.","If the service normally sends errorMessage but does not here, the failure is in its error path — check service logs/version.","Pin or update the skill script to match the deployed chart service version."],"exampleFix":"// before: failure reason lost when errorMessage is absent\nif (!data.success) { throw new Error(data.errorMessage || 'Unknown error'); }\n\n// after: include the payload context\nif (!data.success) {\n  throw new Error(`Chart generation failed (${chartType}): ${data.errorMessage || JSON.stringify(data).slice(0, 200)}`);\n}","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set(['bar','line','pie','scatter', /* from service docs */]);\nif (!SUPPORTED.has(chartType)) { throw new Error(`Unsupported chart type: ${chartType}`); }","typeGuard":"function isChartServiceSuccess(data: unknown): data is { success: true; resultObj: string } {\n  return typeof data === \"object\" && data !== null && Reflect.get(data, \"success\") === true;\n}","tryCatchPattern":"try { url = await generateChartUrl(type, opts); } catch (e) { if (e.message === 'Unknown error') { throw new Error(`Chart service rejected type '${type}' — see service docs`); } throw e; }","preventionTips":["Constrain the LLM prompt/spec to the service's documented types and options.","Always log the full response body when success is false.","Pin the chart service version the skill is written against."],"tags":["skills","chart","external-service","validation","node"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}