Skip to content

Commit 904f532

Browse files
kore-repl: Print human-readable error messages (#2441)
Co-authored-by: andreiburdusa <[email protected]>
1 parent 44eed8d commit 904f532

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

kore/src/Kore/Repl.hs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import Prelude.Kore
1616
import Control.Concurrent.MVar
1717
import Control.Exception
1818
( AsyncException (UserInterrupt)
19+
, fromException
1920
)
2021
import qualified Control.Lens as Lens
2122
import Control.Monad
@@ -87,6 +88,9 @@ import Prof
8788
( MonadProf
8889
)
8990

91+
import Kore.Log.ErrorException
92+
( errorException
93+
)
9094
import Kore.Unification.Procedure
9195
( unificationProcedure
9296
)
@@ -276,9 +280,10 @@ runRepl
276280

277281
catchEverything :: a -> m a -> m a
278282
catchEverything a =
279-
Exception.handleAll $ \e -> liftIO $ do
280-
putStrLn "Stepper evaluation errored."
281-
print e
283+
Exception.handleAll $ \e -> do
284+
case fromException e of
285+
Just (Log.SomeEntry entry) -> Log.logEntry entry
286+
Nothing -> errorException e
282287
pure a
283288

284289
replGreeting :: m ()

0 commit comments

Comments
 (0)