1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum RenderError {
8 #[error(
10 "`decant` was built without the `render` feature. \
11 Reinstall with: cargo install decant --features render"
12 )]
13 FeatureNotEnabled,
14
15 #[cfg(feature = "render")]
17 #[error("browser launch failed: {0}")]
18 BrowserLaunch(String),
19
20 #[cfg(feature = "render")]
22 #[error("lightpanda binary not found: {0}")]
23 LightpandaNotFound(String),
24
25 #[cfg(feature = "render")]
27 #[error("chrome binary not found: {0}")]
28 ChromeNotFound(String),
29
30 #[cfg(feature = "render")]
32 #[error("CDP connection failed: {0}")]
33 CdpConnection(String),
34
35 #[cfg(feature = "render")]
37 #[error("page error for `{url}`: {message}")]
38 Page {
39 url: String,
41 message: String,
43 },
44
45 #[cfg(feature = "render")]
47 #[error("screenshot failed for `{url}`: {message}")]
48 Screenshot {
49 url: String,
51 message: String,
53 },
54}