-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Imprecise exception display #14
Comments
@DoomTaper how about the following errors? >>> from ptp import PTP
>>> p = PTP('w3af')
>>> p.parse()
No parser matched `ToolParser((), {})`
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ptp/ptp.py", line 122, in parse
raise NotSupportedToolError('This tool is not supported by PTP.')
ptp.libptp.exceptions.NotSupportedToolError: This tool is not supported by PTP.
>>> p.parse('foo/bar')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ptp/ptp.py", line 119, in parse
self._init_parser(*args, **kwargs)
File "ptp/ptp.py", line 94, in _init_parser
if parser.is_mine(*args, **kwargs):
File "ptp/tools/w3af/parser.py", line 66, in is_mine
stream = cls.handle_file(pathname, filename, first=first)
File "ptp/libptp/parser.py", line 178, in handle_file
raise IOError("Report matching '%s' cannot be found." % os.path.join(pathname, filename))
IOError: Report matching 'foo/bar/*.xml' cannot be found. |
@DePierre its exactly what I was looking for :) |
Re-opened via 9760a1f#diff-329faea9e46f3af8da40d4c54f4b00ffR106 I am not sure how to properly handle this issue. It would be easy in It might be more accurate to check if |
Although ptp handles precise exceptions but it doesn't show that
e.g.
ptp=PTP('w3af')
ptp.parse('some/random/non-existing/directory')
Below error is shown
Traceback (most recent call last): File "testing.py", line 3, in <module> c = ptp.parse('/root/Desktop/w3af_repo') File "/root/Desktop/ptp/ptp/ptp.py", line 121, in parse raise NotSupportedToolError('This tool is not supported by PTP.') ptp.libptp.exceptions.NotSupportedToolError: This tool is not supported by PTP.
while it should display why the error occurred like above it should show directory doesn't exists or something related to it, helps in correcting error for user itself.
The text was updated successfully, but these errors were encountered: