diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-05-22 15:55:27 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-05-22 15:55:27 -0400 |
| commit | b5f9026a89602a441e717a167c3d753346172885 (patch) | |
| tree | da635a9ea77155dfcf150b13b88db044bf479c78 /src/Utility/Exception.hs | |
| parent | 65ac730c006184472a7d0cb19deffdd69839530f (diff) | |
| parent | 0dd63693b8938a1d9a1319811b3d8bdd1569c60f (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Utility/Exception.hs')
| -rw-r--r-- | src/Utility/Exception.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Utility/Exception.hs b/src/Utility/Exception.hs index 8b110ae6..e691f13b 100644 --- a/src/Utility/Exception.hs +++ b/src/Utility/Exception.hs @@ -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 |
