Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upInvalidEncoding representation #177
Closed
Comments
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like this is used for a very limited set of situations. It should be possible to represent them in a nicer way than
{ desc: &'static str, detail: Option<String> }.InvalidEncoding { desc: "string was not valid utf8", detail: None, } InvalidEncoding { desc: "error while decoding utf8 string", detail: Some(format!("Deserialize error: {}", err)) } InvalidEncoding { desc: "invalid u8 when decoding bool", detail: Some(format!("Expected 0 or 1, got {}", value)) } InvalidEncoding { desc: "Invalid char encoding", detail: None, } InvalidEncoding { desc: "invalid tag when decoding Option", detail: Some(format!("Expected 0 or 1, got {}", value)) }Maybe something like:
with the relevant information in each case to build the error message.