rust-url-parse icon indicating copy to clipboard operation
rust-url-parse copied to clipboard

Idioimatically handle parsing errors

Open HeroicKatora opened this issue 6 years ago • 0 comments

https://github.com/peteyy/rust-url-parse/blob/918ad50c704c67eb474ba0fd9bad76f543290561/neon/native/src/lib.rs#L14-L16

These lines should read Url::parse(&url).map_err(Throw)? where Throw is from neon::vm::Throw. Otherwise, an invalid url would panic and crash the rust program. I don't know how neon reacts to this but it is most likely not intended.

HeroicKatora avatar Nov 27 '17 15:11 HeroicKatora