Skip to main content

browser_url/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum BrowserInfoError {
5    #[error("No active window found")]
6    WindowNotFound,
7
8    #[error("Active window is not a browser")]
9    NotABrowser,
10
11    #[error("Failed to extract URL from browser: {0}")]
12    UrlExtractionFailed(String),
13
14    #[error("Browser detection failed: {0}")]
15    BrowserDetectionFailed(String),
16
17    #[error("Platform-specific error: {0}")]
18    PlatformError(String),
19
20    #[error("Invalid URL format: {0}")]
21    InvalidUrl(String),
22
23    #[error("Timeout during operation")]
24    Timeout,
25
26    #[error("Other error: {0}")]
27    Other(String),
28}
29
30pub type BrowserError = BrowserInfoError;