diff mbox series

[09/11] bitbake-setup: Maintain exception chain

Message ID 20260326185742.542268-10-rob.woolley@windriver.com
State New
Headers show
Series [01/11] bitbake-setup: Remove extraneous variable from str.format() | expand

Commit Message

Rob Woolley March 26, 2026, 6:57 p.m. UTC
Chain the exceptions so that it is easier to trace the exception
back to its root cause.  This resolves B904 linting issues from
flake8-bugbear.

Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
 bin/bitbake-setup | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index e2b2f1836..2e1e347d6 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -579,7 +579,7 @@  def obtain_config(top_dir, registry, args, source_overrides, d):
                     json_data = json.load(f)
                 upstream_config = {'type':'network','uri':config_id,'name':get_config_name(config_id),'data':json_data}
             except json.JSONDecodeError as e:
-                raise Exception ("Invalid JSON from {}. Are you pointing to an HTML page? {}".format(config_id, e))
+                raise Exception ("Invalid JSON from {}. Are you pointing to an HTML page? {}".format(config_id, e)) from e
         else:
             logger.info("Looking up config {} in configuration registry".format(config_id))
             registry_path = update_registry(registry, cache_dir(top_dir), d)