It would be nice to have cause() take a "name" argument that walks the chain of causes until it finds one with the given name. That way you could do something like:
someHttpError.cause('SocketError')
Otherwise, people might end up depending on the exact cause chain (e.g., an HTTP error, then a socket error), which might break if a layer in between adds a useful intermediate message.
It would be nice to have cause() take a "name" argument that walks the chain of causes until it finds one with the given name. That way you could do something like:
Otherwise, people might end up depending on the exact cause chain (e.g., an HTTP error, then a socket error), which might break if a layer in between adds a useful intermediate message.
CC @jclulow @tjfontaine