mirror of
https://git.yoctoproject.org/poky
synced 2026-09-24 22:36:21 +02:00
bitbake: knotty: Improve exception handling
Currently, IOErrors are just passed over due to the broken Exception clause. A command like "bitbake X | <invalid command>" would break stdout triggering a traceback. With these changes we print the exceptions, shut down the server gracefully and exit which is a much nicer behaviour and is less confusion to the user. (Bitbake rev: 9544108f7b413038d871ce6ca88232de2f2434d9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -508,6 +508,10 @@ def main(server, eventHandler, params, tf = TerminalFilter):
|
|||||||
# ignore interrupted io
|
# ignore interrupted io
|
||||||
if ioerror.args[0] == 4:
|
if ioerror.args[0] == 4:
|
||||||
pass
|
pass
|
||||||
|
sys.stderr.write(str(ioerror))
|
||||||
|
if not params.observe_only:
|
||||||
|
_, error = server.runCommand(["stateForceShutdown"])
|
||||||
|
main.shutdown = 2
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
termfilter.clearFooter()
|
termfilter.clearFooter()
|
||||||
if params.observe_only:
|
if params.observe_only:
|
||||||
@@ -526,7 +530,11 @@ def main(server, eventHandler, params, tf = TerminalFilter):
|
|||||||
logger.error("Unable to cleanly shutdown: %s" % error)
|
logger.error("Unable to cleanly shutdown: %s" % error)
|
||||||
main.shutdown = main.shutdown + 1
|
main.shutdown = main.shutdown + 1
|
||||||
pass
|
pass
|
||||||
|
except Exception as e:
|
||||||
|
sys.stderr.write(str(e))
|
||||||
|
if not params.observe_only:
|
||||||
|
_, error = server.runCommand(["stateForceShutdown"])
|
||||||
|
main.shutdown = 2
|
||||||
summary = ""
|
summary = ""
|
||||||
if taskfailures:
|
if taskfailures:
|
||||||
summary += pluralise("\nSummary: %s task failed:",
|
summary += pluralise("\nSummary: %s task failed:",
|
||||||
|
|||||||
Reference in New Issue
Block a user