Skip to content
Prev Previous commit
fix(cloudwatch): use Number.isFinite to also reject Infinity in block…
… config

Aligns block-level validation with route's Zod .finite() refinement so
Infinity/-Infinity are caught at the block config layer, not just the API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • Loading branch information
waleedlatif1 and claude committed Apr 9, 2026
commit 9a4d3945ab2f8f06733a32d1efb2d71ac6c4e652
4 changes: 2 additions & 2 deletions apps/sim/blocks/blocks/cloudwatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,8 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`,
throw new Error('Metric value is required')
}
Comment thread
waleedlatif1 marked this conversation as resolved.
const numericValue = Number(rest.metricValue)
if (Number.isNaN(numericValue)) {
throw new Error('Metric value must be a valid number')
if (!Number.isFinite(numericValue)) {
throw new Error('Metric value must be a finite number')
}

return {
Expand Down
Loading