{"record":{"id":"0dce3b99ac53c073","repo":"santifer/career-ops","slug":"limit-must-be-an-integer-from-1-to-100","errorCode":null,"errorMessage":"--limit must be an integer from 1 to 100","messagePattern":"--limit must be an integer from 1 to 100","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"company-funded.mjs","lineNumber":123,"sourceCode":"    dryRun: false,\n    json: false,\n    selfTest: false,\n    help: false,\n  };\n  for (let i = 0; i < argv.length; i++) {\n    const arg = argv[i];\n    if (arg === '--dry-run') opts.dryRun = true;\n    else if (arg === '--json') opts.json = true;\n    else if (arg === '--self-test') opts.selfTest = true;\n    else if (arg === '--help' || arg === '-h') opts.help = true;\n    else if (arg === '--limit') opts.limit = Number(argv[++i] || '');\n    else if (arg === '--months') opts.months = Number(argv[++i] || '');\n    else if (arg === '--sort') opts.sort = String(argv[++i] || '').trim().toLowerCase();\n    else if (arg === '--sources') opts.sources = parseSources(argv[++i] || '');\n    else throw new Error(`unknown option: ${arg}`);\n  }\n  if (!Number.isInteger(opts.limit) || opts.limit <= 0 || opts.limit > 100) {\n    throw new Error('--limit must be an integer from 1 to 100');\n  }\n  if (!Number.isInteger(opts.months) || opts.months <= 0 || opts.months > 120) {\n    throw new Error('--months must be an integer from 1 to 120');\n  }\n  if (!['date', 'score'].includes(opts.sort)) {\n    throw new Error('--sort must be date or score');\n  }\n  return opts;\n}\n\nfunction parseSources(value) {\n  const out = String(value || '')\n    .split(',')\n    .map((s) => normalizeSourceName(s.trim()))\n    .filter(Boolean);\n  const unique = [...new Set(out)];\n  const allowed = new Set(['techcrunch', 'prnewswire', 'guardian', 'hn']);\n  for (const source of unique) {","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/company-funded.mjs#L105-L141","documentation":"Error \"--limit must be an integer from 1 to 100\" thrown in santifer/career-ops.","triggerScenarios":"Thrown at company-funded.mjs:123 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an integer between 1 and 100 for --limit."],"exampleFix":"node company-funded.mjs --limit 50","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}