Introduce Error::ContextCreationFailed
This commit is contained in:
parent
a33e320521
commit
1e62fdf069
5 changed files with 39 additions and 18 deletions
|
|
@ -11,17 +11,13 @@ pub enum Error {
|
|||
#[error("the application window could not be created")]
|
||||
WindowCreationFailed(winit::error::OsError),
|
||||
|
||||
/// A suitable graphics adapter or device could not be found.
|
||||
#[error("a suitable graphics adapter or device could not be found")]
|
||||
GraphicsAdapterNotFound,
|
||||
/// The application context could not be created.
|
||||
#[error("the application context could not be created")]
|
||||
ContextCreationFailed(iced_graphics::Error),
|
||||
}
|
||||
|
||||
impl From<iced_graphics::Error> for Error {
|
||||
fn from(error: iced_graphics::Error) -> Error {
|
||||
match error {
|
||||
iced_graphics::Error::AdapterNotFound => {
|
||||
Error::GraphicsAdapterNotFound
|
||||
}
|
||||
}
|
||||
Error::ContextCreationFailed(error)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue