Skip to main content

wisp/
error.rs

1//! Crate-level error type.
2
3use thiserror::Error;
4
5/// All errors produced by `wisp`.
6///
7/// Variants are added as features land. Avoid pre-declaring variants without
8/// callers — see `_docs/CONVENTIONS.md` § Error handling.
9#[derive(Debug, Error)]
10pub enum Error {
11    /// No compatible GPU adapter was available.
12    #[error("no compatible GPU adapter available: {0}")]
13    AdapterUnavailable(String),
14
15    /// Requesting a logical device from the adapter failed.
16    #[error("wgpu device request failed: {0}")]
17    DeviceRequest(String),
18
19    /// Placeholder for surfaces that haven't been built yet.
20    #[error("not yet implemented: {0}")]
21    NotImplemented(&'static str),
22}