RFE: more helpful errcodes

Bug #1905043 reported by Peter Sabaini
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Triaged
Wishlist
Unassigned

Bug Description

It seems `snap install` and `snap refresh` only distinguish between fault/success in their exit codes, returning 1 for different faults; e.g.:

peter@pirx ~/tmp » touch bad.snap
peter@pirx ~/tmp » sudo snap install ./bad.snap --dangerous
error: cannot read snap file: "/var/lib/snapd/snaps/.local-install-328837992" is not a snap or
       snapdir
peter@pirx ~/tmp » echo $?
1
peter@pirx ~/tmp » sudo snap install idontexist
error: snap "idontexist" not found
peter@pirx ~/tmp » echo $?
1
peter@pirx ~/tmp » sudo snap install core --asdfadsf
error: unknown flag `asdfadsf'
peter@pirx ~/tmp » echo $? 1

It would be helpful if the cli returned different error codes for different causes, distinguishing between bad resources, network errors, user errors etc. -- would make it easier when calling `snap` from other code to tailor error handling

affects: snapcraft → snapd
Changed in snapd:
importance: Undecided → Wishlist
status: New → Triaged
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.