Description
I am using hyper & hyper-tls to connect to HTTPS endpoints.
I want to do something specific if the endpoint has an invalid TLS certificate or configuration. It seems there is no way to distinguish between all these kinds of errors right now?
I think the error will internally be represented as Kind::Connect
, but I'm not entirely sure. There seems to be a TODO to expose is_connect()
. This might be what I need.
However, I really wish Kind
were public, or maybe a less granular public enum that allows me to distinguish various classes of errors (for example: UserError
, ParseError
, ConnectError
, Closed
, Timeout
). All the is_*
methods on Error
are not ergonomic (quickly turns into many if/else-if statements) and are too easily incomplete when new types of errors are added. I see it in other libraries but I severely dislike it and I never manage to correctly and thoroughly handle all errors this way. Thoughts?