mirror of https://github.com/scrapy/scrapy.git
[itemloader-errors] added error message in get_value
This commit is contained in:
parent
b53ff59a22
commit
8d1e0e09bb
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in New Issue