Skip to content

Commit

Permalink
Preserved original error message
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-asplin-met-no committed Feb 10, 2025
1 parent 800708b commit e5f5712
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ingestion/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub enum Error {

/// Gets an environment variable, providing more details than calling std::env::var() directly.
pub fn getenv(key: &str) -> Result<String, Error> {
std::env::var(key).map_err(|_| Error::Env(format!("Environment variable not found: {}", key)))
std::env::var(key).map_err(|e| Error::Env(format!("{e}: {key}")))
}

impl PartialEq for Error {
Expand Down

0 comments on commit e5f5712

Please sign in to comment.