price is validated only with @IsString(). It flows directly into BigInt(price) downstream. A non-numeric value (e.g. "abc") makes BigInt() throw a plain SyntaxError, which isn't an HttpException, so Nest returns a generic 500 instead of a 400 with a useful message.
Suggested fix: Add @Matches(/^[1-9]\d*$/, { message: 'price must be a positive integer string' }) to the price field.
priceis validated only with@IsString(). It flows directly intoBigInt(price)downstream. A non-numeric value (e.g."abc") makesBigInt()throw a plainSyntaxError, which isn't anHttpException, so Nest returns a generic 500 instead of a 400 with a useful message.Suggested fix: Add
@Matches(/^[1-9]\d*$/, { message: 'price must be a positive integer string' })to thepricefield.