mirror of https://github.com/vee1e/mitmproxy - An interactive TLS-capable intercepting HTTP proxy for penet
Find a file
Nicolas Jeker d72b92bdff
Show exception and stack trace on startup errors (#6491)
#### Description

It's hard to debug errors raised in addon scripts during startup as only
a generic message is output on the console. Using logger.format() to
format errors that occurred during startup instead of only displaying
the LogRecord.msg improves the output if an exception is present by
showing the stack trace. An additional newline was added for better
readability.

Comparison with the load_error.py test script, before:

    $ mitmproxy -s test/mitmproxy/data/addonscripts/load_error.py
    Error logged during startup: Addon error:

After:

    $ mitmproxy -s test/mitmproxy/data/addonscripts/load_error.py
    Error logged during startup:
    Addon error:
    Traceback (most recent call last):
File "test/mitmproxy/data/addonscripts/load_error.py", line 2, in load
        raise ValueError()
    ValueError

Relates to issue #5935 and PR #6020

#### Checklist

 - [ ] I have updated tests where applicable.
- I think the value of extending `test_errorcheck.py` for this behavior
is low and tightly couples the test to `logger.format()`
 - [ ] I have added an entry to the CHANGELOG.
- #6020 didn't introduce a changelog entry, so I figured this won't need
one either
2023-11-18 10:03:50 +01:00
.github build macOS app bundle (#6447) 2023-11-03 11:21:55 +00:00
docs Migrate to ruff (#6433) 2023-10-31 16:03:53 +01:00
examples examples/contrib: link to security plugin 2023-11-06 22:56:24 +01:00
mitmproxy Show exception and stack trace on startup errors (#6491) 2023-11-18 10:03:50 +01:00
release macOS: Use correct entitlements for binary distribution (#6480) 2023-11-13 13:52:55 +01:00
test Add option to return various status codes rather than killing during server replay (#6465) 2023-11-08 11:12:44 +01:00
web Add option to return various status codes rather than killing during server replay (#6465) 2023-11-08 11:12:44 +01:00
.gitattributes
.gitignore update kaitai definitions 2022-07-29 16:13:15 +02:00
CHANGELOG.md mitmproxy 10.1.5 2023-11-14 12:54:48 +00:00
codecov.yml
CONTRIBUTING.md Migrate to ruff (#6433) 2023-10-31 16:03:53 +01:00
LICENSE
MANIFEST.in
pyproject.toml Rename: osproxy -> local redirector (#6453) 2023-11-04 10:52:18 +00:00
README.md readme: fix nits 2022-12-15 17:50:43 +01:00
SECURITY.md
setup.cfg Migrate to ruff (#6433) 2023-10-31 16:03:53 +01:00

mitmproxy

Continuous Integration Status autofix.ci: enabled Coverage Status Latest Version Supported Python versions

mitmproxy is an interactive, SSL/TLS-capable intercepting proxy with a console interface for HTTP/1, HTTP/2, and WebSockets.

mitmdump is the command-line version of mitmproxy. Think tcpdump for HTTP.

mitmweb is a web-based interface for mitmproxy.

Installation

The installation instructions are here. If you want to install from source, see CONTRIBUTING.md.

Documentation & Help

General information, tutorials, and precompiled binaries can be found on the mitmproxy website.

mitmproxy.org

The documentation for mitmproxy is available on our website:

mitmproxy documentation stable mitmproxy documentation dev

If you have questions on how to use mitmproxy, please use GitHub Discussions!

mitmproxy discussions

Contributing

As an open source project, mitmproxy welcomes contributions of all forms.

Dev Guide

Also, please feel free to join our developer Slack! However, please note that the primary purpose of our Slack is direct communication between maintainers and contributors. If you have questions where the answer might be valuable to others, please use GitHub Discussions and not Slack.

Slack Developer Chat