← Back to issue list

`snaphelpers` getting snap config can fail when `snapd` is unavailable`

View original Github issue

Metadata

Project
charmcraft
Number
#921
Type
issue
State
open
Author
mr-cal
Labels
Created
2022-11-04 10:16:14+00:00
Updated
2025-08-15 15:18:22+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

This is a [suggestion](https://github.com/snapcore/snapcraft/pull/3971#pullrequestreview-1165612553) from @cmatsuoka to port some error handling from snapcraft to charmcraft: When charmcraft uses the `snaphelpers` library calls to fetch the snap config (e.g. `snap get charmcraft`), it can raise an `AttributeError` or `snaphelpers.SnapCtlError` if `snapd` is unavailable. The error messages are very unhelpful. Snapcraft solved this by wrapping the `snaphelpers` calls in a try/except block and a better error message ([source](https://github.com/snapcore/snapcraft/blob/main/snapcraft/snap_config.py))

Evaluation history

No evaluation history available.