1use thiserror::Error;
2use web_sys::Element;
3
4pub type Result<T> = std::result::Result<T, Error>;
5
6#[derive(Debug, Error)]
7pub enum Error {
8 #[error("Window not found")]
9 WindowNotFound,
10
11 #[error("Document not found")]
12 DocumentNotFound,
13
14 #[error("Location not found")]
15 LocationNotFound,
16
17 #[error("Specified selectors `{0}` is invalid")]
18 InvalidSelectors(String),
19
20 #[error("Could not found element by `{0}`")]
21 ElementNotFound(String),
22
23 #[error("Object is not an Element")]
24 IsNotAnElement,
25
26 #[error("Could not cast element {0:?}")]
27 ElementNotCast(Element),
28}