summaryrefslogtreecommitdiff
path: root/src/full/Agda/Interaction/Exceptions.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/full/Agda/Interaction/Exceptions.hs')
-rw-r--r--src/full/Agda/Interaction/Exceptions.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/full/Agda/Interaction/Exceptions.hs b/src/full/Agda/Interaction/Exceptions.hs
index 8b6e37f..0c46e82 100644
--- a/src/full/Agda/Interaction/Exceptions.hs
+++ b/src/full/Agda/Interaction/Exceptions.hs
@@ -8,12 +8,14 @@ import Control.Exception as E
import Agda.Syntax.Position
import Agda.Syntax.Parser ( ParseError(..) )
+import Agda.Utils.Pretty
+
handleParseException :: (ParseError -> IO a) -> ParseError -> IO a
handleParseException crash e = crash e
-- | Note that 'failOnException' only catches 'ParseError's.
-failOnException :: (Range -> String -> IO a) -> IO a -> IO a
+failOnException :: (Range -> Doc -> IO a) -> IO a -> IO a
failOnException h m = m `E.catch` handleParseException handler
where
- handler x = h (getRange x) (show x)
+ handler x = h (getRange x) (pretty x)