Skip to main content

procmod_overlay/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum Error {
5    #[error("target window not found")]
6    WindowNotFound,
7
8    #[error("target process does not exist: {pid}")]
9    ProcessNotFound { pid: u32 },
10
11    #[error("process {pid} has no visible top-level window on the current desktop")]
12    ProcessWindowNotFound { pid: u32 },
13
14    #[error("overlay window closed")]
15    OverlayClosed,
16
17    #[error("target window was lost")]
18    TargetWindowLost,
19
20    #[error("failed to create overlay window")]
21    WindowCreation(#[source] std::io::Error),
22
23    #[error("failed to create D3D11 device")]
24    DeviceCreation,
25
26    #[error("failed to create swap chain")]
27    SwapChainCreation,
28
29    #[error("failed to compile shader: {message}")]
30    ShaderCompilation { message: String },
31
32    #[error("failed to create render target")]
33    RenderTarget,
34
35    #[error("renderer error: {message}")]
36    Renderer { message: String },
37
38    #[error("frame not in progress")]
39    NoActiveFrame,
40}
41
42pub type Result<T> = std::result::Result<T, Error>;