Add error type / code enum
Problem Description
In v6 when a *_disconnected event occurred I marked all active flows as aborted. Now in v7 closing a connection triggers an error event for these flows which it did not before. That sounds good to me, but I'd like to differentiate different errors better.
Proposal
Add a type or code to mitmproxy.flow.Error. I think msg is for humans and I'd like a precise way to determine the type of error like "interrupted connections, timeouts, or protocol errors"
This would also serve as implicit documentation about which types of errors exist in mitmproxy land.
Alternatives
Checking the msg which is fragile. Also having the enum gives you an exact list of errors that can occur at all.
Just parking this here
https://github.com/mitmproxy/mitmproxy/blob/fbcffee87f6ca0e8a4bb48123ddd7778ae64a946/mitmproxy/flow.py#L28
Hi, I would like to work on this fix , is this already taken care as part of other bug or still needs to be worked on ?
@snehanemadi feel free to look into this!