Skip to content
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

parse_as gives a bad error if it failed to parse the message #26

Open
museun opened this issue Apr 9, 2023 · 1 comment
Open

parse_as gives a bad error if it failed to parse the message #26

museun opened this issue Apr 9, 2023 · 1 comment

Comments

@museun
Copy link
Owner

museun commented Apr 9, 2023

e.g.

let input = "@reply-parent-msg-id=test_msg_id PRIVMSG #test :usage: !hello <world>\r\n";
let pm = parse_as::<Privmsg>(input).unwrap();

it'll give an error like:
IncorrectMessageType { expected: "Privmsg", got: "Privmsg" }

when its actually a bad parse ("missing the 'prefix' -- which it should handle. but thats another issue)

@museun
Copy link
Owner Author

museun commented May 7, 2023

parse_as() would need to return a Result<T, T::Err> for this to happen

currently it just returns an Option<T>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant