suaviloquence / scrapelect

Declarative web scraping DSL with CSS-inspired syntax
https://suaviloquence.github.io/scrapelect/
Apache License 2.0
1 stars 0 forks source link

use custom error types instead of anyhow #8

Open suaviloquence opened 2 months ago

suaviloquence commented 1 month ago

it would be helpful to have an

enum Error {
  // ...
  Other { 
    message: String,
    cause: Option<Box<dyn std::error::Error>>,
  }

and fn Error::custom(String, Option<Box<dyn Error>>) -> Self

and macro bail!(f, fmt_args*)

and an analog to anyhow::context/with_context

suaviloquence commented 1 month ago

All errors are converted to the scrapelect_filter_types::Error type, now it would be helpful to add more variants instead of mostly using string errors.