Skip to content

[Backend] createStream returns 500 instead of 400 for non-numeric/missing ratePerSecond, depositedAmount or startTime #810

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

stream.controller.ts:73-74 calls BigInt(ratePerSecond) and BigInt(depositedAmount) BEFORE any validation guard. BigInt('abc') throws SyntaxError and BigInt(undefined) throws TypeError, but the catch only maps RangeError to 400 - every other throw falls through to the generic 500. So a malformed/missing numeric field yields 500 rather than 400.

Acceptance criteria

  • POST /v1/streams with non-numeric ratePerSecond or depositedAmount returns 400 with a validation error
  • POST /v1/streams with a missing required numeric field returns 400, not 500
  • Numeric coercion happens after presence/format validation (or is wrapped so any conversion failure maps to 400)

Files to touch

  • backend/src/controllers/stream.controller.ts

Out of scope

  • Stellar address format validation (tracked separately)

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend related tasksbugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions