From 7065a8cc1b8b01cd32d4b1d5317b323fec5238bd Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 7 Mar 2017 14:16:21 +0100 Subject: Bump versions --- webgui/src/Main.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'webgui/src') diff --git a/webgui/src/Main.hs b/webgui/src/Main.hs index 03cd318..65dbfc7 100644 --- a/webgui/src/Main.hs +++ b/webgui/src/Main.hs @@ -40,6 +40,7 @@ import Data.Time import Control.Concurrent import Control.Exception import Control.Monad.Catch +import Control.Monad.Catch.Pure import Control.Applicative import Control.Monad hiding (sequence) @@ -151,9 +152,9 @@ setup Config{..} window (split -> (socketErr, dataUpdate)) = void $ do status <- stepper init statusEvent return (status, triggerStatusChange) - Client{..} = mkClient (hoistNat $ Nat liftIO) server - withFatal :: ExceptT ServantError UI a -> UI a - withFatal a = either (fatal . ("Error while communicating to Thermoprint.Server: " ++) . show) return =<< runExceptT a + Client{..} = (mkClient' server :: Client (CatchT UI)) + withFatal :: CatchT UI a -> UI a + withFatal a = either (fatal . ("Error while communicating to Thermoprint.Server: " ++) . show) return =<< runCatchT a handleEditor selectedPrinter (_, modifyFocusedJobs) = do title <- fatal' "Could not find editor title field" =<< getElementById window "editorTitle" @@ -259,7 +260,7 @@ setup Config{..} window (split -> (socketErr, dataUpdate)) = void $ do enactDeletion <- fatal' "Could not find deletion button" =<< getElementById window "enactDeletion" on UI.click enactDeletion . const $ do cMarking <- currentValue marking - mapM_ (runExceptT . draftDelete) cMarking + mapM_ (runCatchT . draftDelete) cMarking cDraft <- associatedDraft <$> currentValue editorState when (Set.member cDraft $ Set.map Just cMarking) $ changeEditorState (\s -> s { associatedDraft = Nothing } ) updateMarking Set.empty @@ -348,7 +349,7 @@ setup Config{..} window (split -> (socketErr, dataUpdate)) = void $ do (marking, (liftIO .) -> updateMarking) <- stepper' $ Set.empty enactAbortion <- fatal' "Could not find deletion button" =<< getElementById window "enactAbortion" - on UI.click enactAbortion . const $ currentValue marking >>= mapM_ (runExceptT . jobDelete) >> updateMarking Set.empty + on UI.click enactAbortion . const $ currentValue marking >>= mapM_ (runCatchT . jobDelete) >> updateMarking Set.empty (selectedPrinter, updatePrinter) <- do autoselectPrinter <- fatal' "Could not find printer autoselect switch" =<< getElementById window "autoselectPrinter" -- cgit v1.2.3