#### 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
|
||
|---|---|---|
| .github | ||
| docs | ||
| examples | ||
| mitmproxy | ||
| release | ||
| test | ||
| web | ||
| .gitattributes | ||
| .gitignore | ||
| CHANGELOG.md | ||
| codecov.yml | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| MANIFEST.in | ||
| pyproject.toml | ||
| README.md | ||
| SECURITY.md | ||
| setup.cfg | ||
mitmproxy
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.
The documentation for mitmproxy is available on our website:
If you have questions on how to use mitmproxy, please use GitHub Discussions!
Contributing
As an open source project, mitmproxy welcomes contributions of all forms.
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.