summaryrefslogtreecommitdiffstats
path: root/lib/bb/data.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-09-25 15:17:17 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-27 16:41:38 +0100
commitce5c7a95a359cdaecab7c4a519ad4f9df029da82 (patch)
treeec86c6cc6724865e2bdb325798a7cd1e4d7965fa /lib/bb/data.py
parent84ab874c8818484d37ee438aab27486fff497705 (diff)
downloadopenembedded-core-contrib-ce5c7a95a359cdaecab7c4a519ad4f9df029da82.tar.gz
lib/bb/data.py: improve output for expansion errors
Instead of logging the function/variable separately as a NOTE when failing to expand, re-raise ExpansionError with more contextual information. This means that the full details are reported in Hob as well as actually reporting the original error message in any UI where we previously did not. For example, we used to get this with tab/space indentation issues in a python function: NOTE: Error expanding variable populate_packages ERROR: Unable to parse /path/to/recipename.bb Now, we will get this: ERROR: ExpansionError during parsing /path/to/recipename.bb: Failure expanding variable populate_packages: IndentationError: unindent does not match any outer indentation level (<string>, line 4) Fixes [YOCTO #3162]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/data.py')
-rw-r--r--lib/bb/data.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/bb/data.py b/lib/bb/data.py
index 5b7a092a21..9a32353d68 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -323,9 +323,8 @@ def build_dependencies(key, keys, shelldeps, vardepvals, d):
deps |= set((vardeps or "").split())
deps -= set((d.getVarFlag(key, "vardepsexclude", True) or "").split())
- except:
- bb.note("Error expanding variable %s" % key)
- raise
+ except Exception as e:
+ raise bb.data_smart.ExpansionError(key, None, e)
return deps, value
#bb.note("Variable %s references %s and calls %s" % (key, str(deps), str(execs)))
#d.setVarFlag(key, "vardeps", deps)