aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/wic
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-05-27 14:05:20 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-27 17:44:44 +0100
commite5e2c18ce4344c14d9e52ece916333bd0a619281 (patch)
treeb6486e09ad5c9147508d01f919e3c93571288041 /scripts/wic
parentf9b121d8295eb9e297627f4d623164b43349a638 (diff)
downloadopenembedded-core-contrib-e5e2c18ce4344c14d9e52ece916333bd0a619281.tar.gz
wic: refactored processing of wic exceptions
All wic exceptions are now inherited from new base exception class WicError. It makes them easy to maintain and catch. Processing of exceptions is done this way: Known wic exceptions cause wic to print error message to stdout. Unknown exceptions are not catched anymore and produce standard python traceback. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/wic')
-rwxr-xr-xscripts/wic11
1 files changed, 5 insertions, 6 deletions
diff --git a/scripts/wic b/scripts/wic
index 90b36c68ac..cf968591e2 100755
--- a/scripts/wic
+++ b/scripts/wic
@@ -53,6 +53,7 @@ else:
bitbake_main = None
from wic.utils.oe.misc import find_bitbake_env_lines, set_bitbake_env_lines
+from wic.utils.errors import WicError
from image import engine
from image import help as hlp
@@ -309,10 +310,8 @@ def main(argv):
if __name__ == "__main__":
try:
- ret = main(sys.argv[1:])
- except Exception:
- ret = 1
- import traceback
- traceback.print_exc()
- sys.exit(ret)
+ sys.exit(main(sys.argv[1:]))
+ except WicError as err:
+ print >> sys.stderr, "ERROR:", err
+ sys.exit(1)