canonical / prompting-client

GNU General Public License v3.0
8 stars 4 forks source link

feat: structured error responses #132

Closed sminez closed 1 week ago

sminez commented 2 weeks ago

This wires in the structured error responses now provided by snapd so that we can serve better error messages to the user in the UI. The proto files have been updated to cover what we expect to be the full list of possible errors that can be returned from snapd, including a catch all "raw" variant that just provides the raw error message as a string. This is used when there is no structured data from snapd (internal server error, outdated snapd API etc) or if we are unable to parse the structured data included in the error response (breaking API changes, user running misaligned versions of the client & snapd etc).

@olivercalder if you were able to take a look at the proto file in particular to verify that our understanding of the variants is correct that would be really helpful!