opentap / OpenTap.Python

Python integration for OpenTAP
Apache License 2.0
20 stars 6 forks source link

Improved error message when a Python based resource is to be loaded but Python is not installed. #143

Closed jfaaborg closed 9 months ago

jfaaborg commented 9 months ago

When trying to add e.g. a Python based instrument without having Python installed you get the following issue.

Failed to add a resource from package: Runner returned error response: The type PowerSupply.X.X is not compatible with basetype IInstrument.

After installing Python things work - the error message is misleading.

alnlarsen commented 9 months ago

This error message is coming from Runner, not Python.

The Runner generates this error whenever a type does not exist. Runner has no way of knowing whether this is a Python type, or any other plugin type that could not be found. Likewise, Python itself cannot know or communicate that this type would exist if Python was installed.

Python is already loggin errors if Python is not installed. I don't think we can improve this at all.

What we can do, however, is to ship a functional Python installation along with the Python plugin, as a fallback installation if no installation was found or configured.

rmadsen-ks commented 9 months ago

Either of those should not be ignored. If the Runner does not forward the errors it is not a problem that we can fix in this code.