-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - feat: print more error causes #3475
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,33 +16,33 @@ use crate::common::target::TargetError; | |
pub enum CliError { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's remove this and move to anyhow |
||
#[error(transparent)] | ||
OutputError(#[from] OutputError), | ||
#[error("Failed to parse format string")] | ||
#[error("Failed to parse format string: {0}")] | ||
TemplateError(#[from] TemplateError), | ||
|
||
#[cfg(feature = "k8s")] | ||
#[error("Fluvio cluster error")] | ||
#[error("Fluvio cluster error: {0}")] | ||
ClusterCliError(#[from] ClusterCliError), | ||
|
||
#[error("Target Error")] | ||
#[error("Target Error: {0}")] | ||
TargetError(#[from] TargetError), | ||
#[error("Fluvio client error")] | ||
#[error("Fluvio client error: {0}")] | ||
ClientError(#[from] FluvioError), | ||
|
||
#[cfg(feature = "k8s")] | ||
#[error("Kubernetes config error")] | ||
#[error("Kubernetes config error: {0}")] | ||
K8ConfigError(#[from] k8_config::ConfigError), | ||
|
||
#[cfg(feature = "k8s")] | ||
#[error("Kubernetes client error")] | ||
#[error("Kubernetes client error: {0}")] | ||
K8ClientError(#[from] k8_client::ClientError), | ||
|
||
/// An error occurred while processing the connector yaml | ||
#[error("Fluvio connector config")] | ||
#[error("Fluvio connector config: {0}")] | ||
ConnectorConfig(#[from] serde_yaml::Error), | ||
|
||
#[error("Package index error")] | ||
#[error("Package index error: {0}")] | ||
IndexError(#[from] fluvio_index::Error), | ||
#[error("Error finding executable")] | ||
#[error("Error finding executable: {0}")] | ||
WhichError(#[from] which::Error), | ||
#[error("Http Error: {0}")] | ||
HttpError(#[from] fluvio_cli_common::error::HttpError), | ||
|
@@ -65,7 +65,7 @@ pub enum CliError { | |
DataPlaneError(#[from] ErrorCode), | ||
#[error("TableFormat not found: {0}")] | ||
TableFormatNotFound(String), | ||
#[error("Not active profile set in config")] | ||
#[error("No active profile set in config")] | ||
NoActiveProfileInConfig, | ||
#[error("Profile not found in config: {0}")] | ||
ProfileNotFoundInConfig(String), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,47 +18,47 @@ use crate::runtime::local::LocalRuntimeError; | |
#[derive(thiserror::Error, Debug)] | ||
pub enum ClusterError { | ||
/// An error occurred while trying to install Fluvio on Kubernetes | ||
#[error("Failed to install Fluvio on Kubernetes")] | ||
#[error("Failed to install Fluvio on Kubernetes: {0}")] | ||
InstallK8(#[from] K8InstallError), | ||
/// An error occurred while trying to install Fluvio locally | ||
#[error("Failed to install Fluvio locally")] | ||
#[error("Failed to install Fluvio locally: {0}")] | ||
InstallLocal(#[from] LocalInstallError), | ||
/// An error occurred while trying to install Fluvio system charts | ||
#[error("Failed to install Fluvio system charts")] | ||
#[error("Failed to install Fluvio system charts: {0}")] | ||
InstallSys(#[from] ChartInstallError), | ||
/// An error occurred while trying to uninstall Fluvio | ||
#[error("Failed to uninstall Fluvio")] | ||
#[error("Failed to uninstall Fluvio: {0}")] | ||
Uninstall(#[from] UninstallError), | ||
#[error("Progress Error")] | ||
#[error("Progress Error: {0}")] | ||
ProgressError(#[from] TemplateError), | ||
} | ||
|
||
/// Errors that may occur while trying to install Fluvio on Kubernetes | ||
#[derive(thiserror::Error, Debug)] | ||
pub enum K8InstallError { | ||
/// An error occurred with the Kubernetes config. | ||
#[error("Kubernetes config error")] | ||
#[error("Kubernetes config error: {0}")] | ||
K8ConfigError(#[from] K8ConfigError), | ||
/// An error occurred with the Kubernetes client. | ||
#[error("Kubernetes client error")] | ||
#[error("Kubernetes client error: {0}")] | ||
K8ClientError(#[from] K8ClientError), | ||
/// An error occurred while running helm. | ||
#[error("Helm client error")] | ||
#[error("Helm client error: {0}")] | ||
HelmError(#[from] HelmError), | ||
/// An error occurred while running helm. | ||
#[error("Helm Chart error")] | ||
#[error("Helm Chart error: {0}")] | ||
ChartError(#[from] ChartInstallError), | ||
/// Failed to execute a command | ||
#[error(transparent)] | ||
CommandError(#[from] CommandError), | ||
/// One or more pre-checks (successfully) failed when trying to start the cluster | ||
#[error("Pre-checks failed during cluster startup")] | ||
#[error("Pre-checks failed during cluster startup: {0:#?}")] | ||
FailedPrecheck(CheckStatuses), | ||
/// Encountered an error while performing one or more pre-checks | ||
#[error("Failed to perform one or more pre-checks")] | ||
#[error("Failed to perform one or more pre-checks: {0:#?}")] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These kind of formats For these cases I think we could have a one liner, perhaps implementing a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. makes sense! let me try to fix this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed debug prints for now. In next iteration we can implement custom |
||
PrecheckErrored(CheckResults), | ||
/// Failed to update Fluvio cluster | ||
#[error("Expected to find cluster with platform version {0}")] | ||
#[error("Expected to find cluster with platform version: {0}")] | ||
FailedPlatformVersion(String), | ||
/// Timed out when waiting for SC service. | ||
#[error("Timed out when waiting for SC service")] | ||
|
@@ -88,12 +88,12 @@ pub enum K8InstallError { | |
#[error("Missing required config option {0}")] | ||
MissingRequiredConfig(String), | ||
/// Kubectl not found | ||
#[error("kubectl not found")] | ||
#[error("kubectl not found: {0}")] | ||
KubectlNotFoundError(IoError), | ||
/// Kubectl not found | ||
#[error("Port forwarding process exited with code: {0}")] | ||
PortForwardingFailed(ExitStatus), | ||
#[error("Progress Error")] | ||
#[error("Progress Error: {0}")] | ||
ProgressError(#[from] TemplateError), | ||
} | ||
|
||
|
@@ -110,25 +110,25 @@ pub enum LocalInstallError { | |
#[error(transparent)] | ||
IoError(#[from] IoError), | ||
/// An error occurred with the Fluvio client. | ||
#[error("Fluvio client error")] | ||
#[error("Fluvio client error: {0}")] | ||
FluvioError(#[from] FluvioError), | ||
/// An error occurred with the Kubernetes config. | ||
#[error("Kubernetes config error")] | ||
#[error("Kubernetes config error: {0}")] | ||
K8ConfigError(#[from] K8ConfigError), | ||
/// An error occurred with the Kubernetes client. | ||
#[error("Kubernetes client error")] | ||
#[error("Kubernetes client error: {0}")] | ||
K8ClientError(#[from] K8ClientError), | ||
/// An error occurred while running helm. | ||
#[error("Helm client error")] | ||
#[error("Helm client error: {0}")] | ||
HelmError(#[from] HelmError), | ||
/// Failed to execute a command | ||
#[error(transparent)] | ||
CommandError(#[from] CommandError), | ||
/// One or more pre-checks (successfully) failed when trying to start the cluster | ||
#[error("Pre-checks failed during cluster startup")] | ||
#[error("Pre-checks failed during cluster startup: {0:#?}")] | ||
FailedPrecheck(CheckStatuses), | ||
/// Encountered an error while performing one or more pre-checks | ||
#[error("Failed to perform one or more pre-checks")] | ||
#[error("Failed to perform one or more pre-checks: {0:#?}")] | ||
PrecheckErrored(CheckResults), | ||
/// Timed out when waiting for SC service. | ||
#[error("Timed out when waiting for SC service")] | ||
|
@@ -160,7 +160,7 @@ pub enum LocalInstallError { | |
Other(String), | ||
#[error(transparent)] | ||
ClusterCheckError(#[from] ClusterCheckError), | ||
#[error("Progress Error")] | ||
#[error("Progress Error: {0}")] | ||
ProgressError(#[from] TemplateError), | ||
} | ||
|
||
|
@@ -171,19 +171,19 @@ pub enum UninstallError { | |
#[error(transparent)] | ||
IoError(#[from] IoError), | ||
/// An error occurred with the Fluvio client. | ||
#[error("Fluvio client error")] | ||
#[error("Fluvio client error: {0}")] | ||
FluvioError(#[from] FluvioError), | ||
/// Failed to execute a command | ||
#[error(transparent)] | ||
CommandError(#[from] CommandError), | ||
/// An error occurred with the Kubernetes config. | ||
#[error("Kubernetes config error")] | ||
#[error("Kubernetes config error: {0}")] | ||
K8ConfigError(#[from] K8ConfigError), | ||
/// An error occurred with the Kubernetes client. | ||
#[error("Kubernetes client error")] | ||
#[error("Kubernetes client error: {0}")] | ||
K8ClientError(#[from] K8ClientError), | ||
/// An error occurred while running helm. | ||
#[error("Helm client error")] | ||
#[error("Helm client error: {0}")] | ||
HelmError(#[from] HelmError), | ||
/// Timed out when waiting for SC service. | ||
#[error("Timed out when waiting for SC service")] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's get rid of this and move to anyhow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to do anyhow, but then it requires changes in other places in the code. Want to make this change like this and do other PRs for anyhow in future.
This should still print relevant info for now