[yocto] [layerindex-web][PATCH 4/5] update: ensure that exceptions during the update process are logged

Paul Eggleton paul.eggleton at linux.intel.com
Tue Aug 14 06:32:17 PDT 2018


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.eggleton at 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



More information about the yocto mailing list