Skip to content

Use PolarRequestValidationError for seats/units subscription update errors #13912

Description

@stilla

Subscription seat/unit update validation errors (NotASeatBasedSubscription, BelowMinimumSeats, AboveMaximumSeats, SeatsAlreadyAssigned, and the unit-based equivalents introduced in #13871) are plain SubscriptionError/PolarError subclasses returning a flat 400 response, unlike the rest of server/polar/subscription/service.py which uses PolarRequestValidationError for a structured 422 response.

Convert both the seats and units update validation paths (validate_seats_change, validate_units_change in server/polar/subscription/service.py) to raise PolarRequestValidationError instead, for consistency.

Raised from this discussion.

Sent by @frankie567 from PR #13871 dedicated issue creation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions