From 1e62fdf069db5687be510e1cc375260bbff318a7 Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 27 Jan 2022 04:00:53 -0300 Subject: Introduce `Error::ContextCreationFailed` --- graphics/src/error.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'graphics/src/error.rs') diff --git a/graphics/src/error.rs b/graphics/src/error.rs index c86e326a..77758f54 100644 --- a/graphics/src/error.rs +++ b/graphics/src/error.rs @@ -1,7 +1,19 @@ -/// A graphical error that occurred while running an application. +/// An error that occurred while creating an application's graphical context. #[derive(Debug, thiserror::Error)] pub enum Error { - /// A suitable graphics adapter or device could not be found + /// The requested backend version is not supported. + #[error("the requested backend version is not supported")] + VersionNotSupported, + + /// Failed to find any pixel format that matches the criteria. + #[error("failed to find any pixel format that matches the criteria")] + NoAvailablePixelFormat, + + /// A suitable graphics adapter or device could not be found. #[error("a suitable graphics adapter or device could not be found")] - AdapterNotFound, + GraphicsAdapterNotFound, + + /// An error occured in the context's internal backend + #[error("an error occured in the context's internal backend")] + BackendError(String), } -- cgit