aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Error.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Error.hs')
-rw-r--r--src/Text/Pandoc/Error.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Error.hs b/src/Text/Pandoc/Error.hs
index 65f912c88..552fc9c4b 100644
--- a/src/Text/Pandoc/Error.hs
+++ b/src/Text/Pandoc/Error.hs
@@ -39,10 +39,11 @@ import Data.Generics (Typeable)
import GHC.Generics (Generic)
import Control.Exception (Exception)
import Text.Pandoc.Shared (err)
+import System.IO.Error (IOError)
type Input = String
-data PandocError = PandocFileReadError FilePath
+data PandocError = PandocIOError String IOError
| PandocShouldNeverHappenError String
| PandocSomeError String
| PandocParseError String
@@ -57,7 +58,7 @@ handleError :: Either PandocError a -> IO a
handleError (Right r) = return r
handleError (Left e) =
case e of
- PandocFileReadError fp -> err 61 $ "problem reading " ++ fp
+ PandocIOError _ err' -> ioError err'
PandocShouldNeverHappenError s -> err 62 s
PandocSomeError s -> err 63 s
PandocParseError s -> err 64 s