Ticket #1868 (closed bug: wontfix)
Exception fails all exception predicates
| Reported by: | Orphi | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.12 branch |
| Component: | libraries/base | Version: | 6.8.1 |
| Keywords: | Cc: | ||
| Operating System: | Windows | Architecture: | x86 |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
Attempting to operate on a file with an invalid filename (e.g., "C:\C:\") yields an "invalid parameter" exception. This exception appears to be a kind of IOError, yet it fails all 8 exception predicates.
test :: IO x -> IO () test a = do catch (a >> return ()) examine examine :: IOError -> IO () examine ioe = do putStrLn $ "isAlreadyExistsError___" ++ show (isAlreadyExistsError ioe) putStrLn $ "isDoesNotExistError " ++ show (isDoesNotExistError ioe) putStrLn $ "isAlreadyInUseError____" ++ show (isAlreadyInUseError ioe) putStrLn $ "isFullError " ++ show (isFullError ioe) putStrLn $ "isEOFError_____________" ++ show (isEOFError ioe) putStrLn $ "isIllegalOperation " ++ show (isIllegalOperation ioe) putStrLn $ "isPermissionError______" ++ show (isPermissionError ioe) putStrLn $ "isUserError " ++ show (isUserError ioe)
Now try, for example, test (openFile "C:\\C:\\" ReadMode). All 8 predicates above return False. (However, if you do, say, test (error "no"), the catch function doesn't trap it at all because it's not an IOError.)
I was under the impression this is what the "illegal operation" type was for?
Change History
Note: See
TracTickets for help on using
tickets.
