Ben Gamari pushed to branch wip/T27456 at Glasgow Haskell Compiler / GHC

Commits:

3 changed files:

Changes:

  • changelog.d/T27456
    1
    +section: base
    
    2
    +issues: #27456
    
    3
    +mrs: !
    
    4
    +synopsis:
    
    5
    +  Show `ExceptionContext` in `displayExceptionAnnotation` implementation of `WhileHandling`
    
    6
    +description:
    
    7
    +  In the past ``displayException`` (in terms of which ``WhileHandling``\'s ``displayExceptionAnnotation` is implemented) was changed to hide ``ExceptionContext``. This regressed the behavior of ``displayExceptionAnnotation`` from that which was originally specified. Restore the intended behavior of showing the ``ExceptionContext`` of the carried exception.
    
    8
    +

  • libraries/base/changelog.md
    ... ... @@ -31,6 +31,7 @@
    31 31
       * Export `labelThread` from `Control.Concurrent`.([CLC proposal #376](https://github.com/haskell/core-libraries-committee/issues/376))
    
    32 32
       * Add a new module `System.IO.OS` with operations for obtaining operating-system handles (file descriptors, Windows handles). ([CLC proposal #369](https://github.com/haskell/core-libraries-committee/issues/369))
    
    33 33
       * Evaluate backtraces for "error" exceptions at the moment they are thrown. ([CLC proposal #383](https://github.com/haskell/core-libraries-committee/issues/383))
    
    34
    +  * Show `ExceptionContext` in `displayExceptionAnnotation` implementation of `WhileHandling` ([GHC #27456](https://gitlab.haskell.org/ghc/ghc/-/issues/27456))
    
    34 35
       * Hide implementation details when throwing exceptions in throw and throwSTM. ([CLC proposal #387](https://github.com/haskell/core-libraries-committee/issues/387))
    
    35 36
       * Change `hIsReadable` and `hIsWritable` such that they always throw a respective exception when encountering a closed or semi-closed handle, not just in the case of a file handle. ([CLC proposal #371](github.com/haskell/core-libraries-committee/issues/371))
    
    36 37
       * Annotate `onException` continuation with `WhileHandling`. ([CLC Proposal #397](https://github.com/haskell/core-libraries-committee/issues/397))
    

  • libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs
    ... ... @@ -84,7 +84,7 @@ data WhileHandling = WhileHandling SomeException deriving Show
    84 84
     
    
    85 85
     instance ExceptionAnnotation WhileHandling where
    
    86 86
       displayExceptionAnnotation (WhileHandling e) =
    
    87
    -    "While handling " ++ case lines $ displayException e of
    
    87
    +    "While handling " ++ case lines $ displayExceptionWithInfo e of
    
    88 88
           [] -> ""
    
    89 89
           (l1:ls) ->
    
    90 90
             -- Indent lines forward.