canonical / canonical/serialized-data-interface

Refactor Exceptions to include `.status`

Open
#26 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
0
Forks
2
PR merge metrics
No merged PRs in 30d

Description

[OCIImageResourceError](https://github.com/juju-solutions/resource-oci-image/blob/fca2ff473e96db170811b81ffe70505ac70612e8/oci_image.py#L51) and [CheckFailed](https://github.com/canonical/kubeflow-dashboard-operator/blob/2e96dcea52ce6995b49ab439c0d5c04ead22c08c/src/charm.py#L20) have `.status` attribute that make automatically raising a status from an exception easy like shown [here](https://github.com/canonical/kubeflow-dashboard-operator/blob/2e96dcea52ce6995b49ab439c0d5c04ead22c08c/src/charm.py#L59). We should adopt the same pattern here so we can remove helpers like [this](https://github.com/canonical/kubeflow-dashboard-operator/blob/2e96dcea52ce6995b49ab439c0d5c04ead22c08c/src/charm.py#L182) entirely and instead just handle multiple exceptions in the `except (CheckFailed, NoVersionsListed, ...)` block

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.