scraper icon indicating copy to clipboard operation
scraper copied to clipboard

Consider exporting common errors thrown by this crate

Open jannisbecker opened this issue 4 years ago • 2 comments

Some returned Results returned by scraper functions use error types from the cssparser crate. Unfortunately in my project, I cannot handle them (e.g. using thiserror) without adding cssparser to my dependencies as well, even though I don't need it anywhere else.

~~Please consider reexporting cssparser, or alternatively define error types for the scraper crate and export those.~~

Let's define a common error struct for scraper so that crates using it can integrate it in their error handling.

jannisbecker avatar Apr 18 '21 10:04 jannisbecker

The better approach would probably be to define error types in scraper itself and export those.

mainrs avatar Apr 18 '21 12:04 mainrs

Sounds good, yeah. It solves the same issue, so feel free to see this as the solution of this ticket.

jannisbecker avatar Apr 19 '21 18:04 jannisbecker

This is now being addressed in PR #95. Thanks to @Kiwifruit

cfvescovo avatar Dec 19 '22 12:12 cfvescovo