chrome_for_testing/
error.rs

1use std::borrow::Cow;
2use thiserror::Error;
3
4/// Errors that can occur when using this crate.
5#[derive(Debug, Error)]
6pub enum Error {
7    #[error("URL parse error: {0}")]
8    UrlParsing(#[from] url::ParseError),
9
10    /// An HTTP request failed.
11    #[error("HTTP request failed: {0}")]
12    Request(#[from] reqwest::Error),
13
14    /// The current platform is not supported by `chrome-for-testing`.
15    #[error("Platform (os: {os}, arch: {arch}) is not supported.")]
16    UnsupportedPlatform {
17        /// The operating system name, e.g. "linux".
18        os: Cow<'static, str>,
19
20        /// The system architecture name, e.g. "x86_64".
21        arch: Cow<'static, str>,
22    },
23}
24
25/// A convenience type alias for `Result<T, Error>`.
26pub type Result<T> = std::result::Result<T, Error>;