State service doesn't catch permission errors in XDG_RUNTIME_DIR
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
### What needs to get done
If access to XDG_RUNTIME_DIR fails with a permission error, the state service should either raise a user-friendly error and recommend using CRAFT_STATE_DIR or fall back to `util.get_home_temporary_directory()`.
### Why it needs to get done
Craft application raises an internal error when it fails to create a directory here:
https://github.com/canonical/craft-application/blob/e0438e9b1d7db5cbe64c4b48ea92603becf011e4/craft_application/services/state.py#L298-L300
source:
- https://treeherder.mozilla.org/logviewer?job_id=523533578&repo=autoland&task=GPQD26JzTRmaea_iieaqpA.0&lineNumber=233457
- https://matrix.to/#/!GGqzbFAUQprdPgYYCM:ubuntu.com/$zsIwY7Ln07TlXoNsY_WY-eQSSAXitSBqWga4ZMOwViM?via=ubuntu.com&via=matrix.org&via=kde.org
Evaluation history
No evaluation history available.