Render.hs: catch all exceptions, not just VtyConfigurationError

This commit is contained in:
Jonathan Daugherty 2022-07-05 08:15:18 -07:00
parent 1bed2c8268
commit 4c955ad907

View File

@ -12,7 +12,7 @@ import Data.Monoid
#endif #endif
import qualified Graphics.Vty as V import qualified Graphics.Vty as V
import Brick.Widgets.Border (hBorder) import Brick.Widgets.Border (hBorder)
import Control.Exception (try) import Control.Exception (SomeException, try)
region :: V.DisplayRegion region :: V.DisplayRegion
region = (30, 10) region = (30, 10)
@ -34,7 +34,7 @@ expectedResult = "Picture {picCursor = NoCursor, picLayers = [VertJoin {partTop
main :: IO Bool main :: IO Bool
main = do main = do
result <- try (renderDisplay [myWidget]) :: IO (Either V.VtyConfigurationError ()) result <- try (renderDisplay [myWidget]) :: IO (Either SomeException ())
case result of case result of
Left _ -> do Left _ -> do
putStrLn "Terminal is not available, skipping test" putStrLn "Terminal is not available, skipping test"