[Hackage] #512: Use a proper exception for the 'die' utility function

Hackage trac at galois.com
Fri Feb 27 10:44:59 EST 2009

#512: Use a proper exception for the 'die' utility function
  Reporter:  duncan         |        Owner:         
      Type:  defect         |       Status:  new    
  Priority:  normal         |    Milestone:         
 Component:  Cabal library  |      Version:
  Severity:  normal         |     Keywords:         
Difficulty:  unknown        |   Ghcversion:         
  Platform:                 |  
 Currently the `die` function prints the error message to stderror and
 throws an exit with exception. This is not a good approach for library
 code. Instead it should throw an user error exception with the string
 message. A top level handler in `Distribution.Simple.main` or `cabal-
 install` should catch this, print it as before and throw an exit

 See also #510 for an example of how this causes problems. The
 `readPackageDescription` ends up throwing the exit exception when it would
 be more helpful to clients for it to throw an ordinary exception
 containing the error message.

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/512>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list