Async API operations don't return error codes

Bug #1763289 reported by Robert Ancell
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Triaged
Medium
Unassigned

Bug Description

Synchronous snapd API operations return an error string and optional "kind" on error:

{
    "type": "error"
    "status-code": 401,
    "status": "Unauthorized",
    "result": {
        "message": "access denied",
        "kind": "login-required",
    }
}

Async operations can fail (as returned from /v2/changes):

{
    ...
    "status": "Error",
    "err": "Error text"
}

There is no error kind reported here, so a client can't tell what caused the async operation to fail. Suggest solution is to add an "errKind" field or similar to this object.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

I discussed this with John Lenton at the Budapest sprint, but I forgot to open a bug it seems.

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

What specific operation would you be interested in differentiating?

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Operations that are useful to differentiate:
- (install/remove) Abort (i.e. calling /v2/changes/[id] with "action": "abort")
- (install) Download failure (e.g. no network connection)
- (install) Insufficient disk space
- (install/remove) I/O failures (e.g. hard disk failures)

Michael Vogt (mvo)
Changed in snapd:
importance: Undecided → High
status: New → Triaged
Changed in snapd:
importance: High → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.