diff options
| author | Naz <ndpm13@ch-naseem.com> | 2025-10-12 11:00:08 +0100 |
|---|---|---|
| committer | Naz <ndpm13@ch-naseem.com> | 2025-10-12 11:00:08 +0100 |
| commit | 8a4544fc183e112564bdc6ac8511152c92ce7c56 (patch) | |
| tree | fe9102440b8c747f2f29902eecf35007b7c93936 /src/errors.rs | |
| parent | bbce03f95d82d5373f2b6a1c28b03eb25d7bb94c (diff) | |
✨feat: add tracingdev
Diffstat (limited to 'src/errors.rs')
| -rw-r--r-- | src/errors.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/errors.rs b/src/errors.rs index 6b53c2d..dc5a034 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -31,6 +31,9 @@ pub enum Error { #[from] ParseIntError(std::num::ParseIntError), + + #[from] + TracingSubEnvError(tracing_subscriber::filter::FromEnvError), } impl core::fmt::Display for Error { @@ -48,6 +51,7 @@ impl core::fmt::Display for Error { Error::TomlDeError(e) => write!(fmt, "TOML deserialization error: {e}"), Error::TomlSerError(e) => write!(fmt, "TOML serialization error: {e}"), Error::ParseIntError(e) => write!(fmt, "Parsing error: {e}"), + Error::TracingSubEnvError(e) => write!(fmt, "Environment variable error: {e}"), } } } @@ -88,9 +92,13 @@ impl IntoResponse for Error { StatusCode::INTERNAL_SERVER_ERROR, format!("Parsing error: {e}"), ), + Error::TracingSubEnvError(ref e) => ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Environment variable error: {e}"), + ), }; - println!("{} {}", &status, &error_message); + tracing::error!("{} {}", &status, &error_message); (status, error_message).into_response() } } |
