if keys database cannot be opened due to permissions, ignore
This lets readonly repos be used. If a repo is readonly, we can ignore the keys database, because nothing that we can do will change the state of the repo anyway.
This commit is contained in:
parent
0983f136b8
commit
9df13e73ae
5 changed files with 33 additions and 7 deletions
|
@ -21,7 +21,8 @@ module Utility.Exception (
|
|||
tryNonAsync,
|
||||
tryWhenExists,
|
||||
catchIOErrorType,
|
||||
IOErrorType(..)
|
||||
IOErrorType(..),
|
||||
catchPermissionDenied,
|
||||
) where
|
||||
|
||||
import Control.Monad.Catch as X hiding (Handler)
|
||||
|
@ -97,3 +98,6 @@ catchIOErrorType errtype onmatchingerr a = catchIO a onlymatching
|
|||
onlymatching e
|
||||
| ioeGetErrorType e == errtype = onmatchingerr e
|
||||
| otherwise = throwM e
|
||||
|
||||
catchPermissionDenied :: MonadCatch m => (IOException -> m a) -> m a -> m a
|
||||
catchPermissionDenied = catchIOErrorType PermissionDenied
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue