chiark / gitweb /
Postprocessing plugin errors: print them to stderr too
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 6 Feb 2016 16:43:30 +0000 (16:43 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 6 Feb 2016 18:32:03 +0000 (18:32 +0000)
Failures to run the postprocessing plugin are currently mostly ignored
- they result in a message in the slicing engine log, but the slice is
considered to have succeeded.

Ideally slicing engine failures, and plugin failures, would be treated
the same way.  But currently engine errors result in a message on
stderr and the slice simply not finishing in the GUI - that is, there
is not even any way to view the log.

Ideally there would be a `slicing failed' state for the slicing
button, as well as `not yet finished'.  That way the user could know
that something was wrong, and know to look at the log.

For now, however, just print the error message to stderr with
traceback.print_exc, too, so that at least command-line users get to
see something.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Cura/util/pluginInfo.py

index 9cc05f0e73b3dff24374efe7ee2d37600c47586c..7fad6f58e839a9c891eb411e975ea52d534fe49a 100644 (file)
@@ -156,6 +156,7 @@ def runPostProcessingPlugins(engineResult, pluginConfigList):
                try:
                        execfile(pythonFile, locals)
                except:
+                       traceback.print_exc()
                        locationInfo = traceback.extract_tb(sys.exc_info()[2])[-1]
                        return "%s: '%s' @ %s:%s:%d" % (str(sys.exc_info()[0].__name__), str(sys.exc_info()[1]), os.path.basename(locationInfo[0]), locationInfo[2], locationInfo[1])
        if tempfilename is not None: