{"record":{"id":"6dc82683de3b5d10","repo":"remotion-dev/remotion","slug":"maxretries-must-be-finite-but-is-maxretries-6dc826","errorCode":null,"errorMessage":"maxRetries must be finite, but is ${maxRetries}","messagePattern":"maxRetries must be finite, but is (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/validate-retries.ts","lineNumber":11,"sourceCode":"export function validateMaxRetries(\n\tmaxRetries: unknown,\n): asserts maxRetries is number {\n\tif (typeof maxRetries !== 'number') {\n\t\tthrow new TypeError(\n\t\t\t'maxRetries must be a number, but is ' + JSON.stringify(maxRetries),\n\t\t);\n\t}\n\n\tif (!Number.isFinite(maxRetries)) {\n\t\tthrow new TypeError('maxRetries must be finite, but is ' + maxRetries);\n\t}\n\n\tif (Number.isNaN(maxRetries)) {\n\t\tthrow new TypeError('maxRetries is NaN');\n\t}\n\n\tif (maxRetries < 0) {\n\t\tthrow new TypeError(`maxRetries cannot be negative but is ${maxRetries}`);\n\t}\n\n\tif (maxRetries % 1 !== 0) {\n\t\tthrow new TypeError(\n\t\t\t`maxRetries should be an integer, but is ${maxRetries}.`,\n\t\t);\n\t}\n}\n","sourceCodeStart":1,"sourceCodeEnd":28,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/shared/validate-retries.ts#L1-L28","documentation":"Thrown by validateMaxRetries() (a TypeError) when the value is a number but fails Number.isFinite() (Infinity or -Infinity). Retry counts must be a concrete non-negative integer.","triggerScenarios":"Passing Infinity (e.g. Number('Infinity'), divide-by-zero), or a value coerced from 'Infinity' string.","commonSituations":"Defaulting to Infinity intending 'retry forever'; arithmetic that can divide by zero; parsing untrusted input that contained 'Infinity'.","solutions":["Use Number.isFinite() to reject non-finite values before the API call.","Pick a concrete retry count (e.g. 1-3) instead of an unbounded sentinel.","Audit formulas producing maxRetries for divide-by-zero paths."],"exampleFix":"// before\nconst maxRetries = someCount / divisor  // divisor 0 -> Infinity\n// after\nconst maxRetries = Number.isFinite(someCount / divisor) ? someCount / divisor : 1","handlingStrategy":"validation","validationCode":"if (typeof maxRetries === 'number' && !Number.isFinite(maxRetries)) {\n  throw new TypeError('maxRetries must be finite')\n}","typeGuard":"const isFiniteRetries = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && Number.isInteger(v) && v >= 0","tryCatchPattern":null,"preventionTips":["Reject non-finite values with Number.isFinite() before the API call.","Use a concrete retry count instead of 'Infinity'.","Audit retry-count formulas for divide-by-zero paths."],"tags":["aws","lambda","validation","typescript"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}