witer/
error.rs

1use std::io;
2
3use thiserror::Error;
4
5// pub type WindowResult<T> = Result<T, WindowError>;
6
7#[derive(Error, Debug)]
8pub enum WindowError {
9  #[error("{0}")]
10  Error(String),
11  #[error("{0}")]
12  IOError(#[from] io::Error),
13  #[error("{0}")]
14  Win32Error(#[from] windows::core::Error),
15}
16
17#[macro_export]
18macro_rules! window_error {
19  () => {
20    $crate::debug::error::WindowError::Error("window error".to_string())
21  };
22  ($($arg:tt)*) => {{
23    $crate::debug::error::WindowError::Error(format!($($arg)*))
24  }}
25}