diff options
| author | Naz <ndpm13@ch-naseem.com> | 2025-10-11 14:44:12 +0100 |
|---|---|---|
| committer | Naz <ndpm13@ch-naseem.com> | 2025-10-12 09:54:00 +0100 |
| commit | bbce03f95d82d5373f2b6a1c28b03eb25d7bb94c (patch) | |
| tree | 7439ed8038bbb9a08a6b56fbfb90e8bea4b9f2ea /src/errors.rs | |
| parent | 50cf5960cb1f0af831e28eb08b15b97794287f87 (diff) | |
✨feat: add flags to override values in config file
Diffstat (limited to 'src/errors.rs')
| -rw-r--r-- | src/errors.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs index 251ee5f..6b53c2d 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -28,6 +28,9 @@ pub enum Error { #[from] TomlSerError(toml::ser::Error), + + #[from] + ParseIntError(std::num::ParseIntError), } impl core::fmt::Display for Error { @@ -44,6 +47,7 @@ impl core::fmt::Display for Error { Error::SerdeError(e) => write!(fmt, "Serde error: {e}"), 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}"), } } } @@ -80,6 +84,10 @@ impl IntoResponse for Error { StatusCode::INTERNAL_SERVER_ERROR, format!("TOML serialization error: {e}"), ), + Error::ParseIntError(ref e) => ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Parsing error: {e}"), + ), }; println!("{} {}", &status, &error_message); |
