summaryrefslogtreecommitdiff
path: root/src/Command/Run.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Command/Run.hs')
-rw-r--r--src/Command/Run.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Command/Run.hs b/src/Command/Run.hs
index 63d1254..34a32d6 100644
--- a/src/Command/Run.hs
+++ b/src/Command/Run.hs
@@ -410,7 +410,14 @@ cmdRun (RunCommand RunOptions {..} args) = do
outputEvent output $ LogMessage $ "Jobset failed: " <> shortCid <> " " <> T.pack err
loop names (Just ( rest, next ))
- handle @SomeException (\_ -> cancelAllJobs mngr) $ do
+ handle @SomeException
+ (\e -> do
+ if | Just UserInterrupt <- fromException e
+ -> outputEvent output RunInterruptedByUser
+ | otherwise
+ -> outputMessage output $ "exception in run loop: " <> T.pack (show e)
+ cancelAllJobs mngr
+ ) $ do
loop [] =<< atomically (takeJobSource source)
waitForJobs
waitForJobs