summaryrefslogtreecommitdiffstats
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-29 10:17:14 +0100
commit346ef9245db8423796cb3e0675ea82fd973d80f1 (patch)
tree406f522b85957d9f6366182fa602edb6f8cf82a3 /scripts/wic
parent9761becc7f0a0d30198f4ee2b870ff1cb7b8f09f (diff)
downloadpoky-346ef9245db8423796cb3e0675ea82fd973d80f1.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. (From OE-Core rev: e5e2c18ce4344c14d9e52ece916333bd0a619281) 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:
53 bitbake_main = None 53 bitbake_main = None
54 54
55from wic.utils.oe.misc import find_bitbake_env_lines, set_bitbake_env_lines 55from wic.utils.oe.misc import find_bitbake_env_lines, set_bitbake_env_lines
56from wic.utils.errors import WicError
56from image import engine 57from image import engine
57from image import help as hlp 58from image import help as hlp
58 59
@@ -309,10 +310,8 @@ def main(argv):
309 310
310if __name__ == "__main__": 311if __name__ == "__main__":
311 try: 312 try:
312 ret = main(sys.argv[1:]) 313 sys.exit(main(sys.argv[1:]))
313 except Exception: 314 except WicError as err:
314 ret = 1 315 print >> sys.stderr, "ERROR:", err
315 import traceback 316 sys.exit(1)
316 traceback.print_exc()
317 sys.exit(ret)
318 317