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