Openembedded Core Discussions
 help / color / mirror / Atom feed
* [OE-core][PATCH] lib: oe: sbom: Improve SPDX parsing error debugging
@ 2026-07-24 15:30 Joshua Watt
  0 siblings, 0 replies; only message in thread
From: Joshua Watt @ 2026-07-24 15:30 UTC (permalink / raw)
  To: openembedded-core; +Cc: Joshua Watt

Improves the debugging output when parsing an SPDX file fails by
reporting the file name (since this is not normally visible from the
backtrace). Continue to raise the exception after reporting the file
name to get the full backtrace.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 meta/lib/oe/sbom30.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/lib/oe/sbom30.py b/meta/lib/oe/sbom30.py
index 28778651d5..e02382c3cc 100644
--- a/meta/lib/oe/sbom30.py
+++ b/meta/lib/oe/sbom30.py
@@ -977,6 +977,9 @@ def load_jsonld(d, path, required=False):
         if required:
             bb.fatal("No SPDX document named %s found" % path)
         return None
+    except Exception as e:
+        bb.error(f"Unable to parse SPDX document {path}: {e}")
+        raise e
 
     if not objset.doc:
         bb.fatal("SPDX Document %s has no SPDXDocument element" % path)
-- 
2.54.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-24 15:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24 15:30 [OE-core][PATCH] lib: oe: sbom: Improve SPDX parsing error debugging Joshua Watt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox