-
-
Notifications
You must be signed in to change notification settings - Fork 371
Description
This issue keeps track of tasks related to improving errors in kube.
Currently, kube::Error is a huge enum containing all the possible errors, and many error variants don't provide any additional context (e.g., SerdeError(#[from] serde_json::Error)). Users need to constantly ignore irrelevant error variants, and they don't know which are relevant.
The use of #[from] attribute, which derives impl From<T> for kube::Error, allows implicit conversion, so the source code doesn't help much, either. The code is slightly more concise with From, but the information is lost, allows us to be more sloppy, and not think about error cases as much as we should.
We'll start addressing this problem by removing From to force us to attach context, and gradually breaking down the error into smaller and more specific errors (proposed in #686).
Tasks
- Remove
impl From<T> for kube::Errorand require explicit error mapping (Start Refining Errors #686) - Remove
kube_core::Errorand add more specific errors as needed (Start Refining Errors #686) - Break
kube::Errordown to smaller, and more specific error types.- Split
kube::error::ConfigErrorintokube::client::AuthError(only client auth errors), andkube::config::{InferConfigError, InClusterError, KubeconfigError}(Refine more errors #696) - Move
kube::error::OAuthErrortokube::client::auth::oauth::Error(Refine more errors #696) - Move errors from WebSocket upgrade to
kube::client::UpgradeConnectionError(Refine more errors #696) - Split
kube::client::AuthErrorby methods - Add better errors for TLS
-
native-tls(Refine errors for Native TLS #716) -
rustls-tls(Updaterustlsto 0.20.1 #704) -
openssl-tls(Addopenssl-tlsfeature #700)
-
- Move
kube::error::DiscoveryErrortokube::discovery::Error - Add
kube::client::Error - Add
kube::api::Error
- Split
- Add
#[non_exhaustive] - Consistent naming convention
- dependency: Replace
snafuwiththiserrorinkube-runtimeand examples (Start Refining Errors #686) - interoperability: Change
Displayto follow API GuidelinesC-GOOD-ERR: "The error message given by theDisplayrepresentation of an error type should be lowercase without trailing punctuation, and typically concise." - interoperability: Follow the guidelines for implementing
Display::fmtandError::sourceand removesourcefromDisplaywhen the ecosystem is ready. Originally discussed in Don't include sources in their errors'display()#515.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status