You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Display field-specific server errors in instance create form #307
There are some API questions remaining to be resolved, but we would like to display errors in a relatively nice way on the instance create form.
Right now the API only gives one error at a time, and it's pretty barebones:
{
"request_id": "56f2d804-4c19-4413-a062-588bc91a5c32",
"error_code": null,
"message": "unable to parse body: name requires at least one character at line 1 column 107"
}
Work on this ticket should probably wait until the API can give errors on multiple fields at once.
Multi-field error responses probably aren't coming in the next month or so (see RFD 156), so we should make this work with what we have. Unblocked and added to the board.
On second thought, we may want to insist a small amount of API work be done before we get to this. Right now, if a field is invalid, we get
{
"request_id": "dddbb85b-371e-4c6a-a9c4-bb3bfa9a4baf",
"error_code": null,
"message": "unable to parse body: name must begin with an ASCII lowercase character at line 1 column 31"
}
but no structured indicator of which field it’s on. We can either temporarily hack this by pulling the first word after unable to parse body: (easy, really) or we can ask API to add a field key or something. Most or all validation issues should be caught client-side anyway, so we don't expect to see this very often.
Another kind of error, one which we cannot catch client-side, is ObjectAlreadyExists.
This response is similarly inadequate from the console point of view because it doesn't say which field(s) are relevant to the uniqueness check. We know it's name in the case of projects and instances, so we can deal with it that way (hard-coding the fact that ObjectAlreadyExists errors should show up on the name field) but it doesn't feel robust.
Took this and #326 back off the board while we think about this.
changed the title [-]Display server errors in instance create form[/-][+]Display field-specific server errors in instance create form[/+]on May 3, 2021
Not sure if we're going to get API support for this soon, but in any case this isn't really actionable until we do. Made an issue: oxidecomputer/omicron#1848 The closest we're going to get is using the generated Zod validators.
Activity
david-crespo commentedon Apr 30, 2021
Multi-field error responses probably aren't coming in the next month or so (see RFD 156), so we should make this work with what we have. Unblocked and added to the board.
david-crespo commentedon Apr 30, 2021
On second thought, we may want to insist a small amount of API work be done before we get to this. Right now, if a field is invalid, we get
{ "request_id": "dddbb85b-371e-4c6a-a9c4-bb3bfa9a4baf", "error_code": null, "message": "unable to parse body: name must begin with an ASCII lowercase character at line 1 column 31" }but no structured indicator of which field it’s on. We can either temporarily hack this by pulling the first word after
unable to parse body:(easy, really) or we can ask API to add a field key or something. Most or all validation issues should be caught client-side anyway, so we don't expect to see this very often.Another kind of error, one which we cannot catch client-side, is
ObjectAlreadyExists.{ "request_id": "b8787ca8-994d-4681-b637-cae8e8365f56", "error_code": "ObjectAlreadyExists", "message": "already exists: project \"abc\"" }This response is similarly inadequate from the console point of view because it doesn't say which field(s) are relevant to the uniqueness check. We know it's
namein the case of projects and instances, so we can deal with it that way (hard-coding the fact thatObjectAlreadyExistserrors should show up on thenamefield) but it doesn't feel robust.Took this and #326 back off the board while we think about this.
[-]Display server errors in instance create form[/-][+]Display field-specific server errors in instance create form[/+]david-crespo commentedon May 3, 2021
Moved the part of this that's not blocked into #330
david-crespo commentedon Oct 21, 2022
Not sure if we're going to get API support for this soon, but in any case this isn't really actionable until we do. Made an issue: oxidecomputer/omicron#1848 The closest we're going to get is using the generated Zod validators.