diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-11-25 21:30:59 +0100 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-11-27 21:32:10 +0100 |
| commit | 54bf3a5f5c6f660a461d65aea279e698a51c0f1d (patch) | |
| tree | 9d9d9dc235d034586c6c29bf6e23bd25bf8e5dd0 /src/Repo.hs | |
| parent | 0e9a59771131d8d4325aafd4c48ff2ef1267077f (diff) | |
Monad type for job run to provide custom MonadFail instance
Diffstat (limited to 'src/Repo.hs')
| -rw-r--r-- | src/Repo.hs | 3 |
1 files changed, 2 insertions, 1 deletions
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 |