Add error messages to BackendPlugin and enhance exception handling

Exception handling in BackendPlugin has been improved by adding
user-friendly error messages for various exceptions. Errors during
backend plugin start or stop will now trigger a message to the user,
providing more context about the cause of the failure. This makes it
easier for users to understand and resolve possible issues. In addition,
 the EngineBackend stop function has been modified to forcibly stop all
 running backend plugins instead of allowing multiple plugins to run
 simultaneously.
This commit is contained in:
Jelle Spijker 2023-08-10 05:56:24 +02:00
parent 0fc507e556
commit dead016ed9
2 changed files with 27 additions and 7 deletions

View file

@ -203,7 +203,7 @@ class CuraEngineBackend(QObject, Backend):
backend_plugins = CuraApplication.getInstance().getBackendPlugins()
for backend_plugin in backend_plugins:
if backend_plugin.isRunning():
continue
backend_plugin.stop()
# Set the port to prevent plugins from using the same one.
backend_plugin.setPort(self._last_backend_plugin_port)
self._last_backend_plugin_port += 1