Skip to content

Missing predicate for "ResourceVanished" IOException/IOErrorType

IOErrorType has a "ResourceVanished" constructor: https://hackage.haskell.org/package/base-4.10.1.0/docs/src/GHC.IO.Exception.html#IOErrorType

But there is no way to detect this for an IOException or IOErrorType.

Here is some real-world code I found, where the author wants to catch "ResourceVanished", but resorts to catching all IOException: https://hackage.haskell.org/package/http-client-tls-0.3.5.1/docs/src/Network-HTTP-Client-TLS.html#convertConnection

Docs for hPutBuf also mention the public existence of "ResourceVanished": https://hackage.haskell.org/package/base-4.10.1.0/docs/GHC-IO-Handle.html#v:hPutBuf

Suggestion:

We need to add functions:

isResourceVanished :: IOError -> Bool

resourceVanishedErrorType :: IOErrorType

isResourceVanishedErrorType :: IOErrorType -> Bool
Trac metadata
Trac field Value
Version 8.2.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information