[GHC] #12902: Improve handle decoding error messages

GHC ghc-devs at haskell.org
Wed Nov 30 12:50:52 UTC 2016


#12902: Improve handle decoding error messages
-------------------------------------+-------------------------------------
        Reporter:  Profpatsch        |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  libraries/base    |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by Profpatsch:

@@ -13,1 +13,1 @@
- `hGetContents` and similar upwards
+ `hGetContents` and similar upwards)

New description:

 When handle decoding encounters a byte sequence it cannot handle and
 `ErrorOnCodingFailure` is set, at the moment
 [https://hackage.haskell.org/package/base-4.9.0.0/docs/src/GHC.IO.Encoding.Failure.html#ioe_decodingError
 an IO error with a pretty non-descriptive messages is thrown] (`invalid
 byte sequence`).

 The user should get a bit more Information in that case:

 1) What was the byte sequence that caused the error (and if possible where
 in the input, of course hard with handles)

 2) A stack trace of the functions that caused this (probably from
 `hGetContents` and similar upwards)

 It’s a very hard-to-debug error with the current implementation.

--

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


More information about the ghc-tickets mailing list