{"record":{"id":"602446fe6ddc6dca","repo":"lyswhut/lx-music-desktop","slug":"error","errorCode":null,"errorMessage":"无效的自定义源文件","messagePattern":"无效的自定义源文件","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main/modules/userApi/utils.ts","lineNumber":83,"sourceCode":"  for (const info of infoArr) {\n    const result = rxp.exec(info)\n    if (!result) continue\n    const key = result[1] as keyof typeof INFO_NAMES\n    if (INFO_NAMES[key] == null) continue\n    infos[key] = result[2].trim()\n  }\n\n  for (const [key, len] of Object.entries(INFO_NAMES) as Array<{ [K in keyof INFO_NAMES_Type]: [K, INFO_NAMES_Type[K]] }[keyof INFO_NAMES_Type]>) {\n    infos[key] ||= ''\n    if (infos[key] == null) infos[key] = ''\n    else if (infos[key].length > len) infos[key] = infos[key].substring(0, len) + '...'\n  }\n\n  return infos as Record<keyof typeof INFO_NAMES, string>\n}\nconst parseScriptInfo = (script: string) => {\n  const result = /^\\/\\*[\\S|\\s]+?\\*\\//.exec(script)\n  if (!result) throw new Error('无效的自定义源文件')\n\n  let scriptInfo = matchInfo(result[0])\n\n  scriptInfo.name ||= `user_api_${new Date().toLocaleString()}`\n  return scriptInfo\n}\nconst deflateScript = async(script: string) => new Promise<string>((resolve, reject) => {\n  zlib.deflate(Buffer.from(script, 'utf8'), (err, buf) => {\n    if (err) {\n      reject(err)\n      return\n    }\n    resolve('gz_' + buf.toString('base64'))\n  })\n})\nconst inflateScript = async(script: string) => new Promise<string>((resolve, reject) => {\n  if (script.startsWith('gz_')) {\n    zlib.inflate(Buffer.from(script.substring(3), 'base64'), (err, buf) => {","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/lyswhut/lx-music-desktop/blob/9c364b482e5621a1d38b50e8610d2fb974457e6e/src/main/modules/userApi/utils.ts#L65-L101","documentation":"Error \"无效的自定义源文件\" thrown in lyswhut/lx-music-desktop.","triggerScenarios":"Thrown at src/main/modules/userApi/utils.ts:83 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9c364b482e5621a1d38b50e8610d2fb974457e6e","analyzedAt":"2026-08-12T15:14:48.244Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}