Commit 809a1dea authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

'tryCanonicalizePath': throw the correct exception type on Windows.

parent 06a974f3
......@@ -33,8 +33,10 @@ import System.FilePath
import System.IO.Unsafe ( unsafePerformIO )
#if defined(mingw32_HOST_OS)
import Prelude hiding (ioError)
import Control.Monad (liftM2, unless)
import System.Directory (doesDirectoryExist)
import System.IO.Error (ioError, mkIOError, doesNotExistErrorType)
-- | Generic merging utility. For sorted input lists this is a full outer join.
......@@ -148,8 +150,8 @@ tryCanonicalizePath path = do
#if defined(mingw32_HOST_OS)
exists <- liftM2 (||) (doesFileExist ret) (doesDirectoryExist ret)
unless exists $
error $ ret ++ ": canonicalizePath: does not exist "
++ "(No such file or directory)"
ioError $ mkIOError doesNotExistErrorType "canonicalizePath"
Nothing (Just ret)
return ret
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment