1use thiserror::Error;
6
7#[derive(Debug, Error)]
8pub enum BrowserInfoError {
9 #[error("No active window found")]
11 WindowNotFound,
12
13 #[error("Active window is not a browser")]
15 NotABrowser,
16
17 #[error("Failed to extract URL from browser: {0}")]
19 UrlExtractionFailed(String),
20
21 #[error("Browser detection failed: {0}")]
23 BrowserDetectionFailed(String),
24
25 #[error("Platform-specific error: {0}")]
27 PlatformError(String),
28
29 #[error("Invalid URL format: {0}")]
31 InvalidUrl(String),
32
33 #[error("Timeout during operation")]
35 Timeout,
36
37 #[error(
39 "Permission denied: grant Automation access to the browser in System Settings > Privacy & Security > Automation"
40 )]
41 PermissionDenied,
42
43 #[error("Network error: {0}")]
44 NetworkError(String),
45
46 #[error("JSON parse error: {0}")]
47 ParseError(String),
48
49 #[error("No active tabs found")]
50 NoActiveTabs,
51
52 #[error("Chrome DevTools not available")]
53 ChromeDevToolsNotAvailable,
54
55 #[error("Other error: {0}")]
57 Other(String),
58}
59
60pub type BrowserError = BrowserInfoError;