use thiserror::Error;
#[derive(Debug, Error)]
pub enum RenderError {
#[error(
"`decant` was built without the `render` feature. \
Reinstall with: cargo install decant --features render"
)]
FeatureNotEnabled,
#[cfg(feature = "render")]
#[error("browser launch failed: {0}")]
BrowserLaunch(String),
#[cfg(feature = "render")]
#[error("lightpanda binary not found: {0}")]
LightpandaNotFound(String),
#[cfg(feature = "render")]
#[error("chrome binary not found: {0}")]
ChromeNotFound(String),
#[cfg(feature = "render")]
#[error("CDP connection failed: {0}")]
CdpConnection(String),
#[cfg(feature = "render")]
#[error("page error for `{url}`: {message}")]
Page {
url: String,
message: String,
},
#[cfg(feature = "render")]
#[error("screenshot failed for `{url}`: {message}")]
Screenshot {
url: String,
message: String,
},
}