Skip to content

Commit

Permalink
fix: correct wrong error messages and spelling mistakes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzbehsbz committed Apr 7, 2024
1 parent 2032bfe commit cd6ac82
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions src/get_bank_name_by_card_number/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
4 changes: 2 additions & 2 deletions src/get_place_by_iran_national_id/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
10 changes: 5 additions & 5 deletions src/legal_id/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
10 changes: 5 additions & 5 deletions src/number_plate/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
10 changes: 5 additions & 5 deletions src/number_to_words/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
14 changes: 7 additions & 7 deletions src/sheba/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
6 changes: 3 additions & 3 deletions src/verity_card_number/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
4 changes: 2 additions & 2 deletions src/words_to_number/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

0 comments on commit cd6ac82

Please sign in to comment.