summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-10-11 15:50:41 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-10-11 15:50:41 -0700
commit04307a155407480c2bedd4c6f9c121640ba47b11 (patch)
tree82b5d7631fe059dff740b12bbe65ec296e11d8d3
parent0e78eba791233b616f2435f2353586f9d3859480 (diff)
Define Typeable and Exception instances for PandocError.
Closes #2386.
-rw-r--r--src/Text/Pandoc/Error.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Error.hs b/src/Text/Pandoc/Error.hs
index 73d1e8f08..7b0976c6e 100644
--- a/src/Text/Pandoc/Error.hs
+++ b/src/Text/Pandoc/Error.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE DeriveDataTypeable, DeriveGeneric #-}
{-
Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>
@@ -33,6 +34,9 @@ module Text.Pandoc.Error (PandocError(..), handleError) where
import Text.Parsec.Error
import Text.Parsec.Pos hiding (Line)
import Text.Pandoc.Compat.Except
+import GHC.Generics (Generic)
+import Data.Generics (Data, Typeable)
+import Control.Exception (Exception)
type Input = String
@@ -40,8 +44,9 @@ data PandocError = -- | Generic parse failure
ParseFailure String
-- | Error thrown by a Parsec parser
| ParsecError Input ParseError
- deriving (Show)
+ deriving (Show, Typeable, Generic)
+instance Exception PandocError
instance Error PandocError where
strMsg = ParseFailure