From bbce03f95d82d5373f2b6a1c28b03eb25d7bb94c Mon Sep 17 00:00:00 2001 From: Naz Date: Sat, 11 Oct 2025 14:44:12 +0100 Subject: =?UTF-8?q?=E2=9C=A8feat:=20add=20flags=20to=20override=20values?= =?UTF-8?q?=20in=20config=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/errors.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/errors.rs') 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); -- cgit v1.2.3