{"record":{"id":"f83e915746e9f294","repo":"abhigyanpatwari/GitNexus","slug":"errors-join","errorCode":null,"errorMessage":"errors.join('; ')","messagePattern":"errors\\.join\\('; '\\)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/auto-sync/config.ts","lineNumber":271,"sourceCode":"      const overwriteLocalChanges =\n        project.overwrite_local_changes === undefined ? false : project.overwrite_local_changes;\n      if (typeof overwriteLocalChanges !== 'boolean') {\n        errors.push(`projects[${index}].overwrite_local_changes must be a boolean`);\n      }\n\n      if (localPath && remoteUrls.length > 0 && branches.length > 0) {\n        projects.push({\n          localPath,\n          groupName,\n          overwriteLocalChanges: overwriteLocalChanges === true,\n          branches,\n          remoteUrls,\n        });\n      }\n    });\n  }\n\n  if (errors.length > 0) throw new Error(errors.join('; '));\n  return {\n    configPath,\n    syncIntervalMinutes: interval,\n    repoGitTimeoutMs,\n    analyzeTimeoutMs,\n    maxConcurrency,\n    analyzeFailureThreshold,\n    projects,\n  };\n}\n\nexport function validateAutoSyncRemoteUrl(remoteUrl: string): void {\n  const trimmed = remoteUrl.trim();\n  if (trimmed.includes('?') || trimmed.includes('#')) {\n    throw new Error('must not include query strings or fragments');\n  }\n  const match = /^git@([^:\\s/]+):([^\\s]+)$/.exec(trimmed);\n  if (!match) {","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/0d1aed942f0e8b5d3bac27519fff441aceea722d/gitnexus/src/core/auto-sync/config.ts#L253-L289","documentation":"parseAutoSyncConfig() accumulates all field-level validation problems (interval, timeouts, concurrency, remotes, etc.) into an `errors` array and throws them joined with '; ' when any exist. This single message aggregates every schema violation found in the auto-sync config file so users can fix them in one pass.","triggerScenarios":"Providing any invalid value in the auto-sync config: non-positive or non-integer sync_interval_minutes, negative timeouts, maxConcurrency < 1, malformed remote entries — anything pushed into the errors array.","commonSituations":"Setting sync_interval_minutes to 0 or 'hourly', negative analyzeTimeoutMs, forgetting units, or a hand-edited config with several typos at once.","solutions":["Read each ';'-separated segment of the message and fix every listed field.","Set sync_interval_minutes to a positive integer (minutes).","Ensure timeouts and maxConcurrency are positive integers within allowed ranges.","Fix remote entries so each passes validateAutoSyncRemoteUrl (SSH URL on allowed hosts, no query/fragment).","Re-run the command; repeat until no errors are reported."],"exampleFix":"// before\nsync_interval_minutes: 0\nanalyze_timeout_ms: -5\n// after\nsync_interval_minutes: 30\nanalyze_timeout_ms: 600000","handlingStrategy":"validation","validationCode":"const cfg = yaml.load(fs.readFileSync(path,'utf8'));\nconst errs = [];\nif (!Number.isInteger(Number(cfg.sync_interval_minutes)) || Number(cfg.sync_interval_minutes) <= 0) errs.push('sync_interval_minutes must be a positive integer');\nif (errs.length) throw new Error(errs.join('; '));","typeGuard":null,"tryCatchPattern":"try {\n  const cfg = loadAutoSyncConfig(path);\n} catch (e) {\n  for (const msg of String(e.message).split('; ')) console.error('-', msg.trim());\n  process.exitCode = 1;\n}","preventionTips":["Fix every ';'-separated message segment before re-running","Use positive integers for intervals, timeouts, and concurrency","Validate each remote URL with the same rules the CLI uses","Keep a known-good config checked in and diff against it"],"tags":["configuration","auto-sync","schema-validation","yaml"],"backgroundTag":"schema-validation-failed","analyzedSha":"0d1aed942f0e8b5d3bac27519fff441aceea722d","analyzedAt":"2026-09-08T00:40:44.970Z","contentChangedAt":"2026-09-08T00:40:44.970Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}