{-# language CPP #-}
-- No documentation found for Chapter "Exception"
module OpenXR.Exception  (OpenXrException(..)) where

import GHC.Exception.Type (Exception(..))
import OpenXR.Core10.Enums.Result (Result)
import OpenXR.Core10.Enums.Result (Result(..))
-- | This exception is thrown from calls to marshalled Vulkan commands
-- which return a negative VkResult.
newtype OpenXrException = OpenXrException { OpenXrException -> Result
vulkanExceptionResult :: Result }
  deriving (OpenXrException -> OpenXrException -> Bool
(OpenXrException -> OpenXrException -> Bool)
-> (OpenXrException -> OpenXrException -> Bool)
-> Eq OpenXrException
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OpenXrException -> OpenXrException -> Bool
$c/= :: OpenXrException -> OpenXrException -> Bool
== :: OpenXrException -> OpenXrException -> Bool
$c== :: OpenXrException -> OpenXrException -> Bool
Eq, Eq OpenXrException
Eq OpenXrException =>
(OpenXrException -> OpenXrException -> Ordering)
-> (OpenXrException -> OpenXrException -> Bool)
-> (OpenXrException -> OpenXrException -> Bool)
-> (OpenXrException -> OpenXrException -> Bool)
-> (OpenXrException -> OpenXrException -> Bool)
-> (OpenXrException -> OpenXrException -> OpenXrException)
-> (OpenXrException -> OpenXrException -> OpenXrException)
-> Ord OpenXrException
OpenXrException -> OpenXrException -> Bool
OpenXrException -> OpenXrException -> Ordering
OpenXrException -> OpenXrException -> OpenXrException
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: OpenXrException -> OpenXrException -> OpenXrException
$cmin :: OpenXrException -> OpenXrException -> OpenXrException
max :: OpenXrException -> OpenXrException -> OpenXrException
$cmax :: OpenXrException -> OpenXrException -> OpenXrException
>= :: OpenXrException -> OpenXrException -> Bool
$c>= :: OpenXrException -> OpenXrException -> Bool
> :: OpenXrException -> OpenXrException -> Bool
$c> :: OpenXrException -> OpenXrException -> Bool
<= :: OpenXrException -> OpenXrException -> Bool
$c<= :: OpenXrException -> OpenXrException -> Bool
< :: OpenXrException -> OpenXrException -> Bool
$c< :: OpenXrException -> OpenXrException -> Bool
compare :: OpenXrException -> OpenXrException -> Ordering
$ccompare :: OpenXrException -> OpenXrException -> Ordering
$cp1Ord :: Eq OpenXrException
Ord, ReadPrec [OpenXrException]
ReadPrec OpenXrException
Int -> ReadS OpenXrException
ReadS [OpenXrException]
(Int -> ReadS OpenXrException)
-> ReadS [OpenXrException]
-> ReadPrec OpenXrException
-> ReadPrec [OpenXrException]
-> Read OpenXrException
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OpenXrException]
$creadListPrec :: ReadPrec [OpenXrException]
readPrec :: ReadPrec OpenXrException
$creadPrec :: ReadPrec OpenXrException
readList :: ReadS [OpenXrException]
$creadList :: ReadS [OpenXrException]
readsPrec :: Int -> ReadS OpenXrException
$creadsPrec :: Int -> ReadS OpenXrException
Read, Int -> OpenXrException -> ShowS
[OpenXrException] -> ShowS
OpenXrException -> String
(Int -> OpenXrException -> ShowS)
-> (OpenXrException -> String)
-> ([OpenXrException] -> ShowS)
-> Show OpenXrException
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OpenXrException] -> ShowS
$cshowList :: [OpenXrException] -> ShowS
show :: OpenXrException -> String
$cshow :: OpenXrException -> String
showsPrec :: Int -> OpenXrException -> ShowS
$cshowsPrec :: Int -> OpenXrException -> ShowS
Show)

instance Exception OpenXrException where
  displayException :: OpenXrException -> String
displayException (OpenXrException r :: Result
r) = Result -> String
forall a. Show a => a -> String
show Result
r String -> ShowS
forall a. [a] -> [a] -> [a]
++ ": " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Result -> String
resultString Result
r

-- | A human understandable message for each VkResult
resultString :: Result -> String
resultString :: Result -> String
resultString = \case
  
  r :: Result
r -> Result -> String
forall a. Show a => a -> String
show Result
r