Skip to content

Commit

Permalink
improves error msg for invalid values (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahadarsh committed Mar 4, 2024
1 parent d0bb023 commit 6c5c82d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tembo-cli/src/cmd/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ fn validate_environment(env: &str, section: &str, verbose: bool) -> Result<(), a
Ok(())
}
std::result::Result::Err(_) => Err(Error::msg(format!(
"Invalid environment setting in section '{}': {}",
"Invalid environment setting in section '{}': {}. Values allowed: dev, test, prod",
section, env
))),
}
Expand All @@ -141,7 +141,7 @@ fn validate_cpu(cpu: &str, section: &str, verbose: bool) -> Result<(), anyhow::E
Ok(())
}
std::result::Result::Err(_) => Err(Error::msg(format!(
"Invalid cpu setting in section '{}': {}",
"Invalid cpu setting in section '{}': {}. Example cpu setting: 1",
section, cpu
))),
}
Expand All @@ -159,7 +159,7 @@ fn validate_memory(memory: &str, section: &str, verbose: bool) -> Result<(), any
Ok(())
}
std::result::Result::Err(_) => Err(Error::msg(format!(
"Invalid memory setting in section '{}': {}",
"Invalid memory setting in section '{}': {}. Example memory setting: 8Gi",
section, memory
))),
}
Expand All @@ -177,7 +177,7 @@ fn validate_storage(storage: &str, section: &str, verbose: bool) -> Result<(), a
Ok(())
}
std::result::Result::Err(_) => Err(Error::msg(format!(
"Invalid storage setting in section '{}': {}",
"Invalid storage setting in section '{}': {}. Example storage setting: 10Gi",
section, storage
))),
}
Expand Down

0 comments on commit 6c5c82d

Please sign in to comment.