[itemloader-errors] added error message in get_value

This commit is contained in:
Mabel Villalba 2019-06-20 10:06:06 +02:00
parent b53ff59a22
commit 8d1e0e09bb
1 changed files with 9 additions and 3 deletions

View File

@ -106,11 +106,17 @@ class ItemLoader(object):
value = arg_to_iter(value)
value = flatten(extract_regex(regex, x) for x in value)
for proc in processors:
for _proc in processors:
if value is None:
break
proc = wrap_loader_context(proc, self.context)
value = proc(value)
proc = wrap_loader_context(_proc, self.context)
try:
value = proc(value)
except Exception as e:
raise ValueError(
"Error with processor %s value=%r error='%s: %s'" %
(_proc.__class__.__name__, value, type(e).__name__,
str(e)))
return value
def load_item(self):