If an exception occurred during the update then we were managing to save
the update record, but we did not include the exception traceback in the
log for the update. Catch the exception and log it which ensures it gets
captured in the update record and still gets printed as well.

Signed-off-by: Paul Eggleton <paul.eggle...@linux.intel.com>
---
 layerindex/update.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/layerindex/update.py b/layerindex/update.py
index 14529498..aea7cd09 100755
--- a/layerindex/update.py
+++ b/layerindex/update.py
@@ -540,6 +540,10 @@ def main():
     except KeyboardInterrupt:
         logger.info('Update interrupted, exiting')
         sys.exit(254)
+    except Exception:
+        import traceback
+        logger.error(traceback.format_exc().rstrip())
+        sys.exit(1)
     finally:
         update.log = ''.join(listhandler.read())
         update.finished = datetime.now()
-- 
2.17.1

-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to