{"record":{"id":"411586471e74a1d9","repo":"actualbudget/actual","slug":"unknown-detail-code-line-0","errorCode":null,"errorMessage":"Unknown Detail Code: ${line[0]}","messagePattern":"Unknown Detail Code: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/loot-core/src/server/transactions/import/qif2json.ts","lineNumber":102,"sourceCode":"        division.category = sArray[0];\n        if (sArray[1] !== undefined) {\n          division.subcategory = sArray[1];\n        }\n        break;\n      case 'E':\n        division.description = line.substring(1);\n        break;\n      case '$':\n        division.amount = parseFloat(line.substring(1));\n        if (!(transaction.division instanceof Array)) {\n          transaction.division = [];\n        }\n        transaction.division.push(division);\n        division = {};\n        break;\n\n      default:\n        throw new Error('Unknown Detail Code: ' + line[0]);\n    }\n  }\n\n  if (Object.keys(transaction).length) {\n    transactions.push(transaction);\n  }\n  return data;\n}\n","sourceCodeStart":84,"sourceCodeEnd":111,"githubUrl":"https://github.com/actualbudget/actual/blob/d4334cb6e6123f4d3bcea1ad6166608884c7e658/packages/loot-core/src/server/transactions/import/qif2json.ts#L84-L111","documentation":"While parsing QIF transaction lines, each line's first character is a detail code (D, T, P, N, etc.). When the parser encounters a leading character it has no handler for, it throws this error naming the unknown code. This guards against silently dropping transaction data from a malformed or extended QIF dialect.","triggerScenarios":"A QIF file containing line codes outside the supported set — e.g. vendor-specific extension codes like 'L' in unexpected contexts, 'A' address lines handled inconsistently, or a corrupted line where a code character was lost/mangled.","commonSituations":"Exports from less common accounting software using nonstandard QIF extensions; files produced by a broken export tool emitting truncated lines; copy-paste artifacts introducing stray characters.","solutions":["Identify the offending line/code from the error and check whether your bank's exporter emits nonstandard QIF extension codes.","Sanitize the file: remove or remap unsupported line codes to supported ones before parsing.","Re-export the QIF with a simpler/standard profile from the source application.","As a last resort, pre-process the file to strip unknown single-letter-prefixed lines, accepting possible data loss."],"exampleFix":"// before\nconst data = qif2json.parse(rawQif);\n// after\nconst sanitized = rawQif\n  .split(/\\r?\\n/)\n  .filter(l => /^[A-Za-z]/.test(l) === false || 'DMTNPQCALUEM^'.includes(l[0]))\n  .join('\\n');\nconst data = qif2json.parse(sanitized);","handlingStrategy":"try-catch","validationCode":"// Pre-scan for unsupported detail codes\nconst known = new Set(['D','T','P','N','Q','C','A','L','M','E','S','$','^','U','!']);\nconst unknown = content.split(/\\r?\\n/).filter(l => l && !known.has(l[0]) && l[0] !== '!');\nif (unknown.length) console.warn('Unknown QIF codes:', unknown.map(l => l[0]));","typeGuard":null,"tryCatchPattern":"try {\n  const data = parseQIF(file);\n} catch (e) {\n  if (e.message.startsWith('Unknown Detail Code:')) {\n    const code = e.message.split(': ')[1];\n    showError(`QIF contains unsupported detail code '${code}' — re-export in standard QIF`);\n  } else { throw e; }\n}","preventionTips":["Scan the file for single-letter-prefixed lines outside the known code set before importing","Prefer the standard/simple QIF export profile from the source application","Log the offending line (included in the message context) to identify vendor extensions"],"tags":["import","qif","parsing","unsupported-format"],"backgroundTag":"unsupported-format-code","analyzedSha":"d4334cb6e6123f4d3bcea1ad6166608884c7e658","analyzedAt":"2026-08-29T01:02:11.213Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}