LIB: fix throwDirDoesExist exception type

This commit is contained in:
Julian Ospald 2015-12-18 15:28:04 +01:00
parent e67d68ab15
commit 34c6223c25
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -36,6 +36,7 @@ data FmIOException = FileDoesNotExist String
| NotAFile String
| NotADir String
| DestinationInSource String String
| DirDoesExist String
deriving (Show, Typeable)
@ -65,7 +66,7 @@ throwNotAbsolute fp = unless (isAbsolute fp) (throw $ PathNotAbsolute fp)
throwDirDoesExist :: FilePath -> IO ()
throwDirDoesExist fp = do
exists <- doesDirectoryExist fp
when exists (throw $ FileDoesNotExist fp)
when exists (throw $ DirDoesExist fp)
throwDirDoesNotExist :: FilePath -> IO ()