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

#512: Use a proper exception for the 'die' utility function ----------------------------+----------------------------------------------- Reporter: duncan | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.6.0.1 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 exception. 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

#512: Use a proper exception for the 'die' utility function
----------------------------+-----------------------------------------------
Reporter: duncan | Owner:
Type: defect | Status: closed
Priority: normal | Milestone:
Component: Cabal library | Version: 1.6.0.1
Severity: normal | Resolution: fixed
Keywords: | Difficulty: unknown
Ghcversion: | Platform:
----------------------------+-----------------------------------------------
Changes (by duncan):
* status: new => closed
* resolution: => fixed
Comment:
Done
{{{
Sun Mar 1 19:51:43 GMT 2009 Duncan Coutts
participants (1)
-
Hackage