This is something I have already discussed on IRC with @facundobatista, just leaving it here so it doesn’t get lost in channel traffic.
It seems the error message for when no tracks exist (other that the default latest) or the track name is typoed produces the same error message:
sergiusens@gotham:~/projects/snapcore/snapcraft$ surl -a staging-package_update https://dashboard.staging.snapcraft.io/dev/api/snaps/3X1pu4K4BTC5WA3wmVoVa2oJZtNAZ7Mn/metadata -d '{"default_track": "foo"}' | jq .
{
"error_list": [
{
"code": "invalid-choice",
"message": "Select a valid choice. That choice is not one of the available choices.",
"extra": {
"value": "foo",
"field": "default_track"
}
}
]
}
It would be ideal if we could have two different errors for this, maybe:
- code:
no-tracks
- code:
invalid-track
(invalid-choice
is fine), an attribute inextra
andmessage
could list what the valid tracks are.