lib/eco/api/session/batch/errors.rb in eco-helpers-1.3.16 vs lib/eco/api/session/batch/errors.rb in eco-helpers-1.3.17

- old
+ new

@@ -67,16 +67,18 @@ end.compact end def errors entries.each_with_object([]) do |entry, arr| - if errs = status[entry].body["errors"] - errs.each do |msg| - arr.push({ - type: klass = Eco::API::Error.get_type(msg), - err: klass.new(err_msg: msg, entry: entry, session: session), - entry: entry - }) + if body = status[entry].body + if errs = body["errors"] + errs.each do |msg| + arr.push({ + type: klass = Eco::API::Error.get_type(msg), + err: klass.new(err_msg: msg, entry: entry, session: session), + entry: entry + }) + end end end end end