{"record":{"id":"c6b908fe1dd71444","repo":"alibaba/arthas","slug":"illegal-datasource-format-must-be-line-or-tree-c6b908","errorCode":null,"errorMessage":"Illegal dataSource format, must be 'line' or 'tree'","messagePattern":"Illegal dataSource format, must be 'line' or 'tree'","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"labs/arthas-jfr-frontend/src/components/FlameGraph/flame-graph-class.js","lineNumber":613,"sourceCode":"  }\n\n  attributeChangedCallback(name, oldVal, newVal) {\n    if (!this.$dataSource || oldVal === newVal) {\n      return;\n    }\n    this.render(true, false);\n  }\n\n  set dataSource(dataSource) {\n    if (!dataSource.format) {\n      throw new Error(\"Should specify the format of dataSource: 'line' or 'tree'\");\n    }\n    if (typeof dataSource.format !== 'string') {\n      throw new Error('Illegal dataSource format type, must be string');\n    }\n    let format = dataSource.format.toLowerCase();\n    if ('line' !== format && 'tree' !== format) {\n      throw new Error(\"Illegal dataSource format, must be 'line' or 'tree'\");\n    }\n    this.$dataSource = dataSource;\n    this.render(true, true);\n  }\n\n  get dataSource() {\n    return this.$dataSource;\n  }\n\n  set configuration(configuration) {\n    if (typeof configuration !== 'object') {\n      throw new Error('Configuration should be an object');\n    }\n    this.$configuration = configuration;\n  }\n\n  get configuration() {\n    return this.$configuration;","sourceCodeStart":595,"sourceCodeEnd":631,"githubUrl":"https://github.com/alibaba/arthas/blob/21cf2e9ba52b305290be7223b980ff504bb9cb5b/labs/arthas-jfr-frontend/src/components/FlameGraph/flame-graph-class.js#L595-L631","documentation":"dataSource setter lowercases format and throws if it is not exactly 'line' or 'tree'. Unlike error 5/0 (which uses raw case), this setter path is case-insensitive; it only rejects genuinely unsupported format names.","triggerScenarios":"Passing { format: 'csv' }, { format: 'json' }, or a typo like 'tre'.","commonSituations":"Format name from another profiler; user-facing label that does not map to the two supported names.","solutions":["Translate the upstream format name to 'line' or 'tree'.","Use 'line' for sample strings and 'tree' for nested node structures.","Constrain the input source to the two allowed values."],"exampleFix":"// before\nel.dataSource = { format: 'stacks', data };\n\n// after\nel.dataSource = { format: 'line', data };","handlingStrategy":"validation","validationCode":"const f = dataSource.format.toLowerCase();\nif (f !== 'line' && f !== 'tree') throw new Error('unsupported format ' + f);","typeGuard":"function isValidFormat(ds) { const f = ds && typeof ds.format === 'string' ? ds.format.toLowerCase() : ''; return f === 'line' || f === 'tree'; }","tryCatchPattern":null,"preventionTips":["Constrain format input to line|tree.","Translate upstream format names at the boundary."],"tags":["flame-graph","web-component","data-validation"],"backgroundTag":null,"analyzedSha":"21cf2e9ba52b305290be7223b980ff504bb9cb5b","analyzedAt":"2026-08-14T00:57:07.243Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}