-
Notifications
You must be signed in to change notification settings - Fork 62
Description
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).
Line 972 in c2cabd3
| 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.