-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix:handle unloaded namespaces #51
Conversation
happens every boot ``` Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: 2024-09-18 19:45:11.325 - gui - ovos_gui_plugin_shell_companion:handle_remove_namespace:84 - INFO - Got Clear Namespace Event In Skill Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: [E 240918 19:45:11 _base:342] exception calling callback for <Future at 0xffff8463a250 state=finished raised IndexError> Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: Traceback (most recent call last): Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: File "/usr/lib/python3.11/concurrent/futures/_base.py", line 340, in _invoke_callbacks Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: callback(self) Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: File "/home/ovos/.venv/lib/python3.11/site-packages/pyee/_executor.py", line 57, in _callback Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: self.emit("error", exc) Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: File "/home/ovos/.venv/lib/python3.11/site-packages/pyee/_base.py", line 118, in emit Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: self._emit_handle_potential_error(event, args[0] if args else None) Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: File "/home/ovos/.venv/lib/python3.11/site-packages/pyee/_base.py", line 88, in _emit_handle_potential_error Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: raise error Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: result = self.fn(*self.args, **self.kwargs) Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: File "/home/ovos/.venv/lib/python3.11/site-packages/ovos_gui/namespace.py", line 1014, in handle_namespace_global_back Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: namespace_name = self.active_namespaces[0].skill_id Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: ~~~~~~~~~~~~~~~~~~~~~~^^^ Sep 18 19:45:11 OpenVoiceOS ovos-gui-websocket[793]: IndexError: list index out of range ```
WalkthroughThe changes introduce error handling in the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
Outside diff range and nitpick comments (1)
ovos_gui/namespace.py (1)
781-784
: LGTM with a minor suggestion!The added error handling looks good and prevents further execution when there are no active namespaces. The logic for loading pages in the active namespace is correct as well.
As a minor suggestion, consider catching a more specific exception like
IndexError
instead of the genericException
for better error handling.
happens every boot
Summary by CodeRabbit
Bug Fixes
New Features