4 Commits

Author SHA1 Message Date
Ian Johnson
0aab832d6b daemon, client: add QuotaChangeContlict + ErrorKindQuotaChangeConflict
Use a more proper error kind for quota conflicts, supporting the error type
*servicestate.QuotaChangeConflictError inside errToResponse and indicating what
sort of change the conflict is being used for.

Also update the unit tests for the daemon error response to check for this.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-07-05 13:30:29 -05:00
Samuele Pedroni
d63c5e798b daemon: move errors-related code from response.go into errors.go 2021-06-09 16:58:42 +02:00
Samuele Pedroni
9648f2910b daemon: small tweaks and typo fix
thanks @stolowski
2021-06-01 14:16:21 +02:00
Samuele Pedroni
793ce20605 daemon: introduce apiError StructuredResponse
apiError is a StructuredResponse (and also an error), the plan is to
use it everywhere instead of building the complicated respJSON for
errors directly

it can also be used as a return type for functions that are meant
exactly to build errors
2021-05-28 19:48:19 +02:00