summaryrefslogtreecommitdiff
path: root/src/Command/Run.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-07-06 12:02:29 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2026-07-11 15:24:37 +0200
commitb162d2e23a500bb362aaf2b94d8d3ee8f3651163 (patch)
tree43eb0809e27bda1d17490ce6f46d23013b77845d /src/Command/Run.hs
parent4d2de6a51f555cb2365e161c082223e7d9f21bc8 (diff)
Print exception cought in the run loopHEADmaster
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