Panic module.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
module Panic (
|
||||
FatalError(..),
|
||||
panic,
|
||||
) where
|
||||
|
||||
import Base (Show)
|
||||
import Data.Text(Text)
|
||||
import Control.Exception as X
|
||||
|
||||
-- | Uncatchable exceptions thrown and never caught.
|
||||
data FatalError = FatalError { msg :: Text }
|
||||
deriving (Show)
|
||||
|
||||
instance Exception FatalError
|
||||
|
||||
panic :: Text -> a
|
||||
panic a = throw (FatalError a)
|
||||
Reference in New Issue
Block a user