Added better error handling
This commit is contained in:
parent
e4b1917333
commit
dc6fc474be
8 changed files with 136 additions and 105 deletions
17
src/error.rs
Normal file
17
src/error.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
use std::error::Error;
|
||||
use raw_window_handle::{HasRawWindowHandle, RawWindowHandle};
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum SoftBufferError<W: HasRawWindowHandle> {
|
||||
#[error(
|
||||
"The provided window returned an unsupported platform: {human_readable_platform_name}."
|
||||
)]
|
||||
UnsupportedPlatform {
|
||||
window: W,
|
||||
human_readable_platform_name: &'static str,
|
||||
handle: RawWindowHandle,
|
||||
},
|
||||
#[error("Platform error")]
|
||||
PlatformError(Option<String>, Option<Box<dyn Error>>)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue