diff --git a/src/get_bank_name_by_card_number/errors.rs b/src/get_bank_name_by_card_number/errors.rs index 4e97188..9fd21d5 100644 --- a/src/get_bank_name_by_card_number/errors.rs +++ b/src/get_bank_name_by_card_number/errors.rs @@ -3,9 +3,9 @@ use thiserror::Error; #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Error, Clone, PartialEq, Eq, Debug, Hash)] pub enum BankNameByCardNumberError { - #[error("card number: {0:?} with length of {1:?} is too short minimum is 6")] + #[error("Card number \"{0:?}\" with a length of {1:?} is too short; minimum length is 6.")] TooShort(String, usize), - #[error("card number {0:?} does not match any bank")] + #[error("Card number {0:?} does not match any bank.")] NotFound(String), } diff --git a/src/get_place_by_iran_national_id/errors.rs b/src/get_place_by_iran_national_id/errors.rs index 3b0c25b..8a7fcf5 100644 --- a/src/get_place_by_iran_national_id/errors.rs +++ b/src/get_place_by_iran_national_id/errors.rs @@ -3,9 +3,9 @@ use thiserror::Error; #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Error, Debug, PartialEq, Eq, Clone, Copy, Hash)] pub enum PlaceByNationalIdError { - #[error("national id is too short len:{0}")] + #[error("National ID is too short. Length: {0}")] TooShortNationalId(usize), - #[error("place not found")] + #[error("Place not found for the given National ID.")] NotFound, } diff --git a/src/legal_id/errors.rs b/src/legal_id/errors.rs index 37f59d6..63a5981 100644 --- a/src/legal_id/errors.rs +++ b/src/legal_id/errors.rs @@ -3,18 +3,18 @@ use thiserror::Error; #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Error, Debug, PartialEq, Eq, Clone, Copy, Hash)] pub enum VerifyLegalIdError { - #[error("invalid len legal id should be 11 chars")] + #[error("Invalid length. Legal ID should be exactly 11 characters.")] InvalidLength, - #[error("invalid digit")] + #[error("There is an invalid digit in the input.")] InvalidDigit, - #[error("invalid legal id")] + #[error("Legal ID is invalid.")] Invalid, - #[error("invalid legal id")] + #[error("Input checksum is invalid.")] InvalidChecksum, - #[error("you should not see this error. make a issue on our github please.")] + #[error("You should not see this! Please create an issue on our GitHub repository.")] InternalError, } diff --git a/src/number_plate/errors.rs b/src/number_plate/errors.rs index 97b0625..3f150ed 100644 --- a/src/number_plate/errors.rs +++ b/src/number_plate/errors.rs @@ -3,14 +3,14 @@ use thiserror::Error; #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Error, Debug, PartialEq, Eq, Clone, Hash)] pub enum PlateNumberError { - #[error("plate numbers must be 7 or 8 digits long")] + #[error("Plate numbers must be 7 or 8 digits long.")] InvalidPlateDigitLength, - #[error("invalid plate char length (7 for motorcycles, 8 for cars)")] + #[error("Invalid plate character length. Motorcycles should have 7 characters, and cars should have 8.")] InvalidPlateCharacterLength, - #[error("invalid plate char {0:?}")] + #[error("Invalid plate character: {0}")] InvalidPlateCharacter(String), - #[error("invalid motorcycle province code {0:?}")] + #[error("Invalid motorcycle province code: {0:?}")] MotorcycleProvinceNotFound(String), - #[error("invalid car province code {0:?}")] + #[error("Invalid car province code: {0:?}")] CarProvinceNotFound(String), } diff --git a/src/number_to_words/error.rs b/src/number_to_words/error.rs index 50aba1f..43fa83b 100644 --- a/src/number_to_words/error.rs +++ b/src/number_to_words/error.rs @@ -3,18 +3,18 @@ use thiserror::Error; #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Error, Clone, Debug, Hash, PartialEq, Eq)] pub enum NumberToWordsError { - #[error("number_to_words_str input is empty")] + #[error("The input is empty.")] EmptyString, - #[error("number_to_words_str invalid integer -> \"{0}\"")] + #[error("There is an invalid integer in the input: \"{0}\"")] InvalidInteger(String), - #[error("number_to_words_str integer overflow -> \"{0}\"")] + #[error("Overflow occurred while processing the integer: \"{0}\"")] Overflow(String), - #[error("number_to_words_str unknown -> \"{0}\"")] + #[error("Unknown error occurred: \"{0}\"")] Unknown(String), - #[error("number_to_words_str you should not see this error, please make an issue on github")] + #[error("You should not see this! Please create an issue on our GitHub repository.")] Internal, } diff --git a/src/sheba/errors.rs b/src/sheba/errors.rs index 677e908..8e179d7 100644 --- a/src/sheba/errors.rs +++ b/src/sheba/errors.rs @@ -5,25 +5,25 @@ use thiserror::Error; #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Error, Clone, Copy, Debug, Hash, PartialEq, Eq)] pub enum ShebaValidationError { - #[error("empty")] + #[error("The input is empty.")] Empty, - #[error("not started with IR")] + #[error("The input does not start with 'IR'.")] NotStartedWithIR, - #[error("invalid digit")] + #[error("There is an invalid digit in the input.")] InvalidDigit, - #[error("invalid length: {0:?}")] + #[error("Input length is invalid: {0:?}")] InvalidLength(usize), - #[error("invalid checksum")] + #[error("Input checksum is invalid.")] InvalidChecksum, - #[error("bank not found")] + #[error("Bank information not found.")] BankNotFound, - #[error("you should not see this! please make a issue on our github")] + #[error("You should not see this! Please create an issue on our GitHub repository.")] InternalError, } diff --git a/src/verity_card_number/errors.rs b/src/verity_card_number/errors.rs index 246726c..d92eb95 100644 --- a/src/verity_card_number/errors.rs +++ b/src/verity_card_number/errors.rs @@ -5,13 +5,13 @@ use thiserror::Error; #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Error, Debug, PartialEq, Eq)] pub enum VerifyCardNumberError { - #[error("invalid digit")] + #[error("There is an invalid digit in the input.")] InvalidDigit, - #[error("invalid length")] + #[error("Input length is invalid.")] InvalidLength, - #[error("invalid length")] + #[error("Input format is not a valid card number.")] InvalidCardNumber, } diff --git a/src/words_to_number/errors.rs b/src/words_to_number/errors.rs index 2c54060..6361080 100644 --- a/src/words_to_number/errors.rs +++ b/src/words_to_number/errors.rs @@ -3,8 +3,8 @@ use thiserror::Error; #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Error, Clone, Copy, Debug, Hash, PartialEq, Eq)] pub enum WordsToNumberError { - #[error("There is a invalid unit in the input")] + #[error("There is an invalid unit in the input.")] InvalidUnit, - #[error("The input cannot be a empty string")] + #[error("The input cannot be an empty string.")] EmptyInput, }