From 54bf3a5f5c6f660a461d65aea279e698a51c0f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Wed, 25 Nov 2026 21:30:59 +0100 Subject: Monad type for job run to provide custom MonadFail instance --- src/Repo.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Repo.hs') diff --git a/src/Repo.hs b/src/Repo.hs index 9fab2f7..fbcded0 100644 --- a/src/Repo.hs +++ b/src/Repo.hs @@ -489,7 +489,8 @@ readCommittedFile Tree {..} path = do pushToBranch :: (MonadIO m, MonadFail m) => Branch -> Commit -> m () pushToBranch Branch {..} Commit {..} = do when (not $ gitWritable branchRepo) $ do - fail $ "repo ‘" <> gitDir branchRepo <> "’ is not writable" + -- throw IO exception to generate JobError instead of JobFailed + liftIO $ fail $ "repo ‘" <> gitDir branchRepo <> "’ is not writable" join $ liftIO $ withMVar (gitLock branchRepo) $ \_ -> withMVar (gitLock commitRepo) $ \_ -> do -- cgit v1.2.3