1 {-# LANGUAGE DeriveDataTypeable, ExistentialQuantification #-}
2 module JVM.Exceptions where
4 import Control.Monad.Exception
5 import qualified Data.ByteString.Lazy as B
9 data NoItemInPool = forall a. Show a => NoItemInPool a
12 instance Exception NoItemInPool
14 instance Show NoItemInPool where
15 show (NoItemInPool s) = "Internal error: no such item in pool: <" ++ show s ++ ">"
17 force :: String -> EM AnyException a -> a
20 Right result -> result
21 Left exc -> error $ "Exception at " ++ s ++ ": " ++ show exc