diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-07-21 17:49:52 +0200 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-07-21 17:49:52 +0200 |
commit | 04a651320ba00571a0b2af9ae25c6d6c696c2803 (patch) | |
tree | 7ba2cf8fbc9ebd9acb1f7854ee4bfef7a5028a44 /src/lib.rs | |
parent | ca1eb8dc533301060e2b2768646b15d79c8be60c (diff) | |
parent | 7fe828bed3c1e01c0868d83eada0f2f36209c989 (diff) | |
download | glutin-04a651320ba00571a0b2af9ae25c6d6c696c2803.tar.gz glutin-04a651320ba00571a0b2af9ae25c6d6c696c2803.zip |
Merge pull request #532 from tomaka/precise-errors
Precise errors
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -108,7 +108,11 @@ pub trait GlContext { #[derive(Clone, Debug, PartialEq, Eq)] pub enum CreationError { OsError(String), + /// TODO: remove this error NotSupported, + RobustnessNotSupported, + OpenGlVersionNotSupported, + NoAvailablePixelFormat, } impl CreationError { @@ -116,6 +120,12 @@ impl CreationError { match *self { CreationError::OsError(ref text) => &text, CreationError::NotSupported => "Some of the requested attributes are not supported", + CreationError::RobustnessNotSupported => "Your requested robustness, but it is \ + not supported.", + CreationError::OpenGlVersionNotSupported => "The requested OpenGL version is not \ + supported.", + CreationError::NoAvailablePixelFormat => "Couldn't find any pixel format that matches \ + the criterias.", } } } @@ -465,7 +475,7 @@ impl<'a> BuilderAttribs<'a> { } current_result.or(current_software_result) - .ok_or(CreationError::NotSupported) + .ok_or(CreationError::NoAvailablePixelFormat) } } |