{"record":{"id":"24331d3b43ac1e37","repo":"actualbudget/actual","slug":"validateuploadedfile-error-message-dynamic","errorCode":null,"errorMessage":"validateUploadedFile error message (dynamic)","messagePattern":"validateUploadedFile error message \\(dynamic\\)","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"packages/sync-server/src/app-sync.ts","lineNumber":358,"sourceCode":"    if (e instanceof FileNotFound) {\n      currentFile = null;\n    } else {\n      throw e;\n    }\n  }\n\n  const fileAccessError = currentFile\n    ? requireFileAccess(currentFile, res.locals.user_id)\n    : null;\n  if (fileAccessError) {\n    res.status(403);\n    res.send(fileAccessError);\n    return;\n  }\n\n  const errorMessage = validateUploadedFile(groupId, keyId, currentFile);\n  if (errorMessage) {\n    res.status(400).send(errorMessage);\n    return;\n  }\n\n  try {\n    await fs.writeFile(getPathForUserFile(fileId), req.body);\n  } catch (err) {\n    console.log('Error writing file', err);\n    res.status(500).send({ status: 'error' });\n    return;\n  }\n\n  if (!currentFile) {\n    // it's new\n    const newGroupId = generateGroupId();\n    groupId = newGroupId;\n    filesService.set(\n      new File({\n        id: fileId,","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/actualbudget/actual/blob/d4334cb6e6123f4d3bcea1ad6166608884c7e658/packages/sync-server/src/app-sync.ts#L340-L376","documentation":"Error \"validateUploadedFile error message (dynamic)\" thrown in actualbudget/actual.","triggerScenarios":"Thrown at packages/sync-server/src/app-sync.ts:358 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":"d4334cb6e6123f4d3bcea1ad6166608884c7e658","analyzedAt":"2026-08-29T01:02:11.213Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}