[GHC] #9943: Replace "error" with "errorWithStackTrace" from GHC.Stack in base libs

GHC ghc-devs at haskell.org
Fri Sep 4 11:22:40 UTC 2015


#9943: Replace "error" with "errorWithStackTrace" from GHC.Stack in base libs
-------------------------------------+-------------------------------------
        Reporter:  spacekitteh       |                   Owner:
            Type:  task              |                  Status:  closed
        Priority:  normal            |               Milestone:  7.12.1
       Component:  Core Libraries    |                 Version:
      Resolution:  duplicate         |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:  #5273             |  Differential Revisions:
-------------------------------------+-------------------------------------
Changes (by thomie):

 * status:  new => closed
 * resolution:   => duplicate
 * related:   => #5273
 * milestone:   => 7.12.1


Comment:

 This program:
 {{{
 import Control.Exception

 main = do Left (ex@(ErrorCallWithLocation a b)) <- try $ print (head [] ::
 ())
           putStrLn a
           putStrLn b
           throwIO ex
 }}}

 Now prints:
 {{{
 Prelude.head: empty list
 CallStack:
   error, called at libraries/base/GHC/List.hs:1009:3 in base:GHC.List
 Test: Prelude.head: empty list
 }}}

 I'm not sure why the custom exception handler is needed. Perhaps that will
 be cleared up later.

 I think this ticket can be closed.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9943#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list