From b8032a6eec243e9c243daec30214ea4b3a12d791 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 27 Jun 2011 15:12:47 +0200 Subject: [PATCH] [FIX] error reporting during domain and context evaluation failure maybe, just maybe, interpolating reported data into the error string could be useful for debugging bzr revid: xmo@openerp.com-20110627131247-lv38qdg77v22u4hx --- openerpweb/nonliterals.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openerpweb/nonliterals.py b/openerpweb/nonliterals.py index 643ee8a393b..f999a30e20d 100644 --- a/openerpweb/nonliterals.py +++ b/openerpweb/nonliterals.py @@ -180,9 +180,9 @@ class CompoundDomain(BaseDomain): final_domain = [] for domain in self.domains: if not isinstance(domain, (list, BaseDomain)): - raise TypeError("Domain %r is not a list or a nonliteral Domain", - domain) - + raise TypeError( + "Domain %r is not a list or a nonliteral Domain" % domain) + if isinstance(domain, list): final_domain.extend(domain) continue @@ -210,9 +210,9 @@ class CompoundContext(BaseContext): final_context = {} for context_to_eval in self.contexts: if not isinstance(context_to_eval, (dict, BaseContext)): - raise TypeError("Context %r is not a dict or a nonliteral Context", - context_to_eval) - + raise TypeError( + "Context %r is not a dict or a nonliteral Context" % context_to_eval) + if isinstance(context_to_eval, dict): final_context.update(context_to_eval) continue