Skip to content

Commit

Permalink
Make script loading error more verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas FICHEUX committed Nov 11, 2021
1 parent 18a0791 commit 4478012
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -16,6 +16,7 @@
* Upstream replays don't do CONNECT on plaintext HTTP requests (#4876, @HoffmannP)
* Remove workarounds for old pyOpenSSL versions (#4831, @KarlParkinson)
* Scripts with relative paths are now loaded relative to the config file and not where the command is ran
* Exception raised when loading script which is not a file now shows which file caused the error.

## 28 September 2021: mitmproxy 7.0.4

Expand Down
2 changes: 1 addition & 1 deletion mitmproxy/addons/script.py
Expand Up @@ -77,7 +77,7 @@ def __init__(self, path: str, reload: bool) -> None:
self.ns = None

if not os.path.isfile(self.fullpath):
raise exceptions.OptionsError('No such script')
raise exceptions.OptionsError(f'No such script: {self.fullpath}')

self.reloadtask = None
if reload:
Expand Down

0 comments on commit 4478012

Please sign in to comment.