12 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
Paweł Stołowski
363dc36e7d Implement v2/validation-sets api call. The GET method is used to query validation set(s), POST is used to apply changes to validation sets (monitor or enforce mode, forget). 2020-09-29 12:05:56 +02:00
Paweł Stołowski
4bfaa6b644 Use error code 507. Change error to ErrorKindInsufficientDiskSpace and "insufficient-disk-space". Use strutil.Quoted (thanks pedronis). 2020-09-07 16:44:40 +02:00
Paweł Stołowski
c67d40caf5 Handle insufficient space error in api and client. 2020-09-02 11:57:45 +02:00
Samuele Pedroni
688867207b Merge remote-tracking branch 'upstream/master' into error-kinds-from-client
fix conflicts
2020-08-05 17:48:21 +02:00
Samuele Pedroni
9bdb5244bf client,docs: finalize errors.go comments
add final dots everywhere as recommended by go style guides and
preferred by @degville

adjust docs/error-kinds.go to that

clarify to use docs/error-kinds.go and that the direction of sync
is from code to forum for error kinds.
2020-08-05 14:50:18 +02:00
Samuele Pedroni
e4725a10d5 client,cmd/snap: reorg error kinds and rename some
this is to match more what is currently in daemon/response.go and for
consistency
2020-08-02 16:22:51 +02:00
Samuele Pedroni
b44bce10b7 client,snap,docs: introduce marker type client.ErrorKind
this is going to replace daemon.errorKind as well
2020-08-02 16:22:47 +02:00
Samuele Pedroni
997b3558b8 client: fix whitespace, adjust misleading error description 2020-08-02 15:22:19 +02:00
Samuele Pedroni
4dc537f22a client,docs: standardize error kind doc comments
add what's missing and align forum and doc comments

then have a tool to generate what is on the forum:

$ cd docs
$ go run error-kinds.go

open question: when/if to have a dot at the end? always? only for
multi-sentence comments?
2020-08-02 15:14:14 +02:00
Michael Vogt
391cf184f4 client: wrap ErrorKind doc strings 2020-07-01 15:59:18 +02:00
Michael Vogt
d8dcf9f358 client: move all error kinds into errors.go and add doc strings
This is a simple reshuffle of the exiting error kinds in the
client into their own file with doc strings taken from:
https://forum.snapcraft.io/t/snapd-rest-api/17954

Some doc strings are missing but that is easy to see now via:
```
$ git grep "// ErrorKind.*: "

```
2020-06-30 13:10:30 +02:00