#1868: Exception fails all exception predicates
----------------------------+-----------------------------------------------
 Reporter:  Orphi           |          Owner:             
     Type:  bug             |         Status:  new        
 Priority:  normal          |      Milestone:  6.10 branch
Component:  libraries/base  |        Version:  6.8.1      
 Severity:  normal          |     Resolution:             
 Keywords:                  |     Difficulty:  Unknown    
 Testcase:                  |   Architecture:  x86        
       Os:  Windows         |  
----------------------------+-----------------------------------------------
Comment (by Orphi):

 Mmm, so there's actually quite a lot of different exception types that you
 can't distinguish between currently. That's nice.

 I'm not really sure how some of these errors are meant to be different.
 For example, what's the difference between an `IllegalOperation` and an
 `InvalidArgument`? When would you issue one, when would you issue the
 other? Similarly, what conditions does `SystemError` cover that are not
 already covered by `ProtocolError`, `HardwareFault` and
 `ResourceExhausted`? Is there some documentation somewhere which states
 exactly what each type is meant to cover?

 The documentation in Sytem.IO.Error seems to suggest that
 `IllegalOperation` is intended to be a "catch-all" for any error that
 doesn't fall under the other types. Looking at the above, it seems that's
 not the case.

 I guess probably the best thing to do at this point is just add more
 predicates for detecting ''all'' the possible I/O exception types. But the
 commands in the quoted code seem to suggest that this would break
 compatibility with Haskell 98?

 Basically, I'd just like to be able to write an exception handler and know
 which exception happened so I can decide what to do. Currently that seems
 to be harder than necessary.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1868#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to