on master help sign in
Add exception handler to main

The main function now handles exceptions, printing them to the console. Fixes specifically. Thus, main's exception handler decorates the message with "Uncaught error".

commit3ec0158af0ffcd46fdd9cdc51ab02e6e2bb7b142 authorDavid Christiansen <david@davidchristiansen.dk> dateThu 24 Oct 2013, 15:31 (13 years ago) parentc261501
1 file changed+4−1
src/Main.hs+4−1
src/Main.hs+4−1
@@ -40,7 +40,10 @@ import Paths_idris
4040
4141main = do xs <- getArgs
4242 let opts = parseArgs xs
43− runErrorT $ execStateT (runIdris opts) idrisInit
43+ result <- runErrorT $ execStateT (runIdris opts) idrisInit
44+ case result of
45+ Left err -> putStrLn $ "Uncaught error: " ++ show err
46+ Right _ -> return ()
4447
4548runIdris :: [Opt] -> Idris ()
4649runIdris opts = do