Skip to content

Container validation errors reach users as raw English exception text (CONT-2) #1804

Description

@peterdrier

Section: Containers (caller also in CityPlanning)

Containers Service throws InvalidOperationException with hard-coded English ("Container name must not contain <, > or $.", "A container can have at most 5 images."), and both ContainerController and CityPlanningController (TryCreateContainerAsync / TryUpdateContainerAsync, SetError(ex.Message)) show that text directly.

The nightly sweep tried to fix this in c21664c (#1789). It changed the exception message into a resource key and localized it only in ContainerController, so the BarrioMap admin container form in CityPlanning would have shown the raw Containers_Error_* key. /debt-review reverted it.

To fix this properly, give the error a contract both callers can use. For example, the service returns a typed validation result or error code that Humans.Containers localizes, so CityPlanning never has to read ContainersResource. An exception message should not double as a resource key across a section boundary. Ledger row CONT-2 in src/Sections/Humans.Containers/Docs/debt.yml stays open.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions