mitmproxy / mitmproxy/mitmproxy

Add error type / code enum

Open
#4,554 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted kind/feature
Dominant language
Python
Stars
45.1k
Forks
4.7k
Avg merge
21h 12m
Merged PRs (30d)
16

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating mitmproxy.flow.Error and the connection-close paths that emit error events. Review how interrupted connections, timeouts, and protocol errors are currently represented, then define the expected error categories and verify that each relevant flow error exposes one consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.