Plugins with System Python Module Deps Should Catch Exceptions
Posted: 13.03.2025 23:17
Plugins throwing an exception over missing modules should have error-handling. I got the errors below from cuda_css_inspector. After slogging through various GitHub pages and such, I found out that this plugin expects to find a couple of Python modules on my OS. Please write plugins to say, explicitly, what a user must install to make them work. It's just a "try-catch" clause. Many plugins need nothing special, but those that do should offer more than a raw error in the Python console. Average users think wrongly that CudaText is broken. A concise message that does not look like a bug would help. Thanks!
Code: Select all
Init: cuda_css_inspector
Traceback (most recent call last):
File "/redacted/cudatext/py/cuda_css_inspector/__init__.py", line 7, in <module>
from lxml import etree
ModuleNotFoundError: No module named 'lxml'
ERROR: Exception in CudaText for cuda_css_inspector.show_panel: ModuleNotFoundError: No module named 'lxml'
Init: cuda_css_inspector
Traceback (most recent call last):
File "/redacted/cudatext/py/cuda_css_inspector/__init__.py", line 7, in <module>
from lxml import etree
ModuleNotFoundError: No module named 'lxml'
ERROR: Exception in CudaText for cuda_css_inspector.show_panel: ModuleNotFoundError: No module named 'lxml'