-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better Errors #29
Better Errors #29
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is extremely helpful and needed, thank you!
Would you be able to add a few parser error tests as well as address my notes? I'm fine with follow-ups too :)
src/de.rs
Outdated
|
||
use serde::de::{self, Deserializer as Deserializer_, DeserializeSeed, Visitor}; | ||
|
||
pub type Result<T> = ::std::result::Result<T, Error>; | ||
|
||
#[derive(Clone, Debug, PartialEq)] | ||
pub enum Error { | ||
Message(String), | ||
Parser { kind: ErrorKind, pos: Position }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: doesn't look like names are useful here, could just be Parser(ErrorKind, Position)
src/de.rs
Outdated
} | ||
|
||
#[derive(Clone, Debug, PartialEq)] | ||
pub enum ErrorKind { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be ParserError
or even Parserror
?
This commit improves the error messages generated by CommaSeparated
I have addressed your request, will merge it now because I want to continue work and start another PR. In case you find there are other changes needed, I'll address them in a future PR. bors r+ |
Build succeeded |
Fixes #21