{"record":{"id":"c935cda071ba1185","repo":"paperclipai/paperclip","slug":"invalid-integer-value-value","errorCode":null,"errorMessage":"Invalid integer value: ${value}","messagePattern":"Invalid integer value: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/issue.ts","lineNumber":1364,"sourceCode":"            ? await ctx.api.post(`${apiPath`/api/issues/${issueId}`}${pathSuffix}`, {})\n            : await ctx.api.delete(`${apiPath`/api/issues/${issueId}`}${pathSuffix}`);\n          printOutput(result, { json: ctx.json });\n        } catch (err) {\n          handleCommandError(err);\n        }\n      }),\n  );\n}\n\nfunction parseJson(value: string): unknown {\n  return JSON.parse(value) as unknown;\n}\n\nfunction parseOptionalInt(value: string | undefined): number | undefined {\n  if (value === undefined) return undefined;\n  const parsed = Number.parseInt(value, 10);\n  if (!Number.isFinite(parsed)) {\n    throw new Error(`Invalid integer value: ${value}`);\n  }\n  return parsed;\n}\n\nfunction parseHiddenAt(value: string | undefined): string | null | undefined {\n  if (value === undefined) return undefined;\n  if (value.trim().toLowerCase() === \"null\") return null;\n  return value;\n}\n\nfunction filterIssueRows(rows: Issue[], match: string | undefined): Issue[] {\n  if (!match?.trim()) return rows;\n  const needle = match.trim().toLowerCase();\n  return rows.filter((row) => {\n    const text = [row.identifier, row.title, row.description]\n      .filter((part): part is string => Boolean(part))\n      .join(\"\\n\")\n      .toLowerCase();","sourceCodeStart":1346,"sourceCodeEnd":1382,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/issue.ts#L1346-L1382","documentation":"parseOptionalInt (issue.ts) parses a CLI string option as base-10 integer and throws if the result is not finite. Used for numeric flags like --limit on issue commands.","triggerScenarios":"Passing a non-numeric value to an integer issue flag, e.g. `--limit abc` or `--limit 1.5`.","commonSituations":"Typo; passing a float where an int is expected; env-derived value with trailing whitespace/newline.","solutions":["Pass a plain integer: `--limit 50`.","Omit the flag to use the default.","Sanitize env-derived values before passing them."],"exampleFix":"// before\npaperclipai issue list --limit abc\n// after\npaperclipai issue list --limit 50","handlingStrategy":"validation","validationCode":"function parseOptionalInt(value?: string) {\n  if (value === undefined) return undefined;\n  const parsed = Number.parseInt(value, 10);\n  if (!Number.isFinite(parsed)) throw new Error(`Invalid integer value: ${value}`);\n  return parsed;\n}","typeGuard":"const isIntString = (v: string) => /^-?\\d+$/.test(v.trim());","tryCatchPattern":null,"preventionTips":["Use a CLI parser that casts integer flags before they reach the action.","Validate env-derived values before passing as --limit."],"tags":["cli","issue","input-validation","parsing"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}