1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use easygpu::wgpu::BufferAsyncError;
use easygpu_lyon::lyon_tessellation::TessellationError;

/// All errors that `kludgine-core` can return.
#[derive(thiserror::Error, Debug)]
pub enum Error {
    /// An error opening an image.
    #[error("error reading image: {0}")]
    Image(#[from] image::ImageError),
    /// An error parsing Json.
    #[error("error parsing json: {0}")]
    Json(#[from] json::Error),
    /// An error while rendering shapes.
    #[error("error tessellating shape")]
    Tessellation(TessellationError),
    /// An error while parsing sprite data.
    #[error("error parsing sprite data: {0}")]
    SpriteParse(String),
    /// The sprite's current tag has no frames.
    #[error("no frames could be found for the current tag")]
    InvalidSpriteTag,
    /// An error occurred during offscreen rendering.
    #[error("error acquiring offscreen buffer: {0}")]
    Offscreen(#[from] BufferAsyncError),
}