Skip to content

Commit

Permalink
improve error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Oct 8, 2024
1 parent 12745ee commit 6407dda
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/parsers/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ pub enum Error {
#[error("R/W error: {0}")]
Rw(#[from] rw::error::Error),

#[error("Unrecognized first byte for new bencoded value: {0}, char: {1}")]
#[error("Unrecognized first byte for new bencoded value, received byte: {0}, char: {1}")]
UnrecognizedFirstBencodeValueByte(u8, char),

// Integers
#[error("Unexpected byte parsing integer: {0}, char: {1}")]
#[error("Unexpected byte parsing integer, received byte: {0}, char: {1}")]
UnexpectedByteParsingInteger(u8, char),

#[error("Unexpected end of input parsing integer")]
UnexpectedEndOfInputParsingInteger,

// Strings
#[error("Invalid string length byte, expected a digit: {0}, char: {1}")]
#[error("Invalid string length byte, expected a digit, received byte: {0}, char: {1}")]
InvalidStringLengthByte(u8, char),

#[error("Unexpected end of input parsing string length")]
Expand Down

0 comments on commit 6407dda

Please sign in to comment.