2023-03-04 05:37:11 +01:00
|
|
|
use crate::futures::futures;
|
|
|
|
|
use crate::graphics;
|
2020-09-08 00:35:17 +02:00
|
|
|
|
|
|
|
|
/// An error that occurred while running an application.
|
|
|
|
|
#[derive(Debug, thiserror::Error)]
|
|
|
|
|
pub enum Error {
|
|
|
|
|
/// The futures executor could not be created.
|
|
|
|
|
#[error("the futures executor could not be created")]
|
|
|
|
|
ExecutorCreationFailed(futures::io::Error),
|
|
|
|
|
|
|
|
|
|
/// The application window could not be created.
|
|
|
|
|
#[error("the application window could not be created")]
|
|
|
|
|
WindowCreationFailed(winit::error::OsError),
|
|
|
|
|
|
2022-04-26 19:28:04 -03:00
|
|
|
/// The application graphics context could not be created.
|
|
|
|
|
#[error("the application graphics context could not be created")]
|
2023-03-04 05:37:11 +01:00
|
|
|
GraphicsCreationFailed(graphics::Error),
|
2020-09-08 00:35:17 +02:00
|
|
|
}
|
|
|
|
|
|
2023-03-04 05:37:11 +01:00
|
|
|
impl From<graphics::Error> for Error {
|
2025-03-12 02:10:42 +01:00
|
|
|
fn from(error: graphics::Error) -> Error {
|
2022-04-26 19:28:04 -03:00
|
|
|
Error::GraphicsCreationFailed(error)
|
2020-09-08 00:35:17 +02:00
|
|
|
}
|
|
|
|
|
}
|