packages feed

matrix-market-attoparsec-0.1.1.0: src/Control/Exception/Common.hs

{-# language DeriveDataTypeable #-}
{-# language LambdaCase #-}
module Control.Exception.Common where

import Control.Exception
-- import Control.Monad.Catch (MonadThrow (..))
import Data.Typeable -- (TypeRep, Typeable, typeRep)


data ImportError = FileParseError String String deriving (Eq, Typeable)
instance Show ImportError where
  show = \case
    FileParseError s s2 -> unwords [s, ": File parse error:", s2]
instance Exception ImportError

data ExportError = FormatExportNotSupported String String deriving (Eq, Typeable)
instance Show ExportError where
  show = \case
    FormatExportNotSupported s sty -> unwords [s, ":", sty, "format not supported"]
instance Exception ExportError