-
Notifications
You must be signed in to change notification settings - Fork 433
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
Report usage of unsupported display filter protocol #693
base: master
Are you sure you want to change the base?
Conversation
@@ -344,6 +357,17 @@ async def _get_tshark_process(self, packet_count=None, stdin=None): | |||
parameters = [self._get_tshark_path(), "-l", "-n", "-T", output_type] + \ | |||
self.get_parameters(packet_count=packet_count) + output_parameters | |||
|
|||
if not tshark_supports_protocol(self._display_filter): | |||
suggestions = "or".join(self._suggest_protocol_name(self._display_filter)) | |||
if (suggestions == ""): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not suggestions:
?
suggestions = "or".join(self._suggest_protocol_name(self._display_filter)) | ||
if (suggestions == ""): | ||
raise TSharkProtocolNotSupportedException( | ||
f"Protocol {self._display_filter} is not supported by TShark. " + \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the + \
here, it'll be concatenated anyway
@@ -344,6 +357,17 @@ async def _get_tshark_process(self, packet_count=None, stdin=None): | |||
parameters = [self._get_tshark_path(), "-l", "-n", "-T", output_type] + \ | |||
self.get_parameters(packet_count=packet_count) + output_parameters | |||
|
|||
if not tshark_supports_protocol(self._display_filter): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH this seems like overkill to check it every time we get the process, since it'll only fail very rarely. Maybe we can check it on a crash to explain it?
Fix #692