lib: oe: sbom: Improve SPDX parsing error debugging
PATCH 1/1 lib: oe: sbom: Improve SPDX parsing error debugging
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 <[email protected]>
--- meta/lib/oe/sbom30.py | 3 +++ 1 file changed, 3 insertions(+)
meta/lib/oe/sbom30.py +3 -0
@@ -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)
Signature · 1 line
2.54.0