Skip to content

Increase usage of InvalidValue for a better client error experience #910

@zephraph

Description

@zephraph

Related to oxidecomputer/console#307

When submitting a form from the console we need a mechanism to be able to link server errors back to the inline form. E.g. if the server finds that size is invalid because it's not divisible by block_size then we want to mark the size field as an error. The current mechanism we have to do that is the InvalidValue error. We both need to use it more often and ensure that when we use it that label is actually a field from the request body. I'm uncertain if there's something we can/should do from a types perspective to ensure the latter part.

Here's an example we'd want to fix such that label was only one field (likely size).

label: String::from("size and block_size"),

I suspect given that errors can be deep in the execution path there's going to be a lot of situations where we really aren't able to provide this. That said, in cases where it's doable we should definitely strive for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions