[GHC] #12902: Improve handle decoding error messages

#12902: Improve handle decoding error messages -------------------------------------+------------------------------------- Reporter: Profpatsch | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: | Version: 8.0.1 libraries/base | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- 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.Fa... 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 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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.Fa... 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
participants (1)
-
GHC