@@ -1,3 +1,4 @@
1+{-# LANGUAGE DeriveDataTypeable, DeriveGeneric #-}
2Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>
3Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>
@@ -33,6 +34,9 @@ module Text.Pandoc.Error (PandocError(..), handleError) where
33import Text.Parsec.Error
34import Text.Parsec.Error
34import Text.Parsec.Pos hiding (Line)
35import Text.Parsec.Pos hiding (Line)
35import Text.Pandoc.Compat.Except
36import Text.Pandoc.Compat.Except
37+import GHC.Generics (Generic)
38+import Data.Generics (Data, Typeable)
39+import Control.Exception (Exception)
37type Input = String
41type Input = String
@@ -40,8 +44,9 @@ data PandocError = -- | Generic parse failure
40 ParseFailure String
44 ParseFailure String
41 -- | Error thrown by a Parsec parser
45 -- | Error thrown by a Parsec parser
42 | ParsecError Input ParseError
46 | ParsecError Input ParseError
43− deriving (Show)
47+ deriving (Show, Typeable, Generic)
49+instance Exception PandocError
46instance Error PandocError where
51instance Error PandocError where
47 strMsg = ParseFailure
52 strMsg = ParseFailure