eco-helpers 2.1.9 → 2.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dac932bad9c679aa2f0c5aaa3a5c33ed16f04bde3ca37c55e6b19ae2cae6a418
4
- data.tar.gz: 7d533e95f2738ba4633ac4e62ea06ff414de63b059fbc5f532b2fde4d5940233
3
+ metadata.gz: 7a10a887a29d2f0e2bbfba835c32c6fb2f35ed6cbbc674ad108ec1da81192d50
4
+ data.tar.gz: afc195b30a643cffaadb8b2b271e5d83d4981d1fed3d4111525ec83279a6f825
5
5
  SHA512:
6
- metadata.gz: 3bfb8e874d539c0a8d24ba1a4858130fb48c2a6e905f425bf7ca530d29c05bb01fd371a8d0fa58a9c736bd82f18409867461c6e3f3e2405a5135a700ad4f7784
7
- data.tar.gz: a707033b2e34ca9fbc5c98514319a5d2d034aa8f37d6fd7b81ffa2d0eaddd516c9aac4471393284334225c03b7c75cdcc0cc2ac8938530cb8d53e5de23f52d68
6
+ metadata.gz: 303c97a14c92ec6b0f6b0011726f8836a5d3cc2e096afc4fdcf991b3160e771015b4cf642fb781214b256d0119216a44710fbac4daab700c58950a0c01ca9a9d
7
+ data.tar.gz: 52a52c731cd43dbb56dad4910a26ea5e3e1658f919ff78e6e15d7bc57383e03841e0642c12e801585600abc89f9571dad895b66208703402c25e2a252da46b59
data/CHANGELOG.md CHANGED
@@ -1,12 +1,18 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [2.1.10] - 2022-11-xx
4
+ ## [2.1.11] - 2022-11-xx
5
5
 
6
6
  ### Added
7
7
  ### Changed
8
8
  ### Fixed
9
9
 
10
+ ## [2.1.10] - 2022-11-30
11
+
12
+ ### Fixed
13
+ - `Eco::API::Session::Batch::Errors#errors`
14
+ - include errors with no `error` property in body (i.e. `!response.success?`)
15
+
10
16
  ## [2.1.9] - 2022-11-29
11
17
 
12
18
  ### Changed
data/lib/eco/api/error.rb CHANGED
@@ -76,7 +76,6 @@ module Eco
76
76
  @str_err = "Unknown details field."
77
77
  @match = /details \> (.+?) is an unknown field/
78
78
  end
79
-
80
79
  end
81
80
 
82
81
  class << self
@@ -135,7 +134,6 @@ module Eco
135
134
  @err_msg = err_msg
136
135
  @session = session
137
136
  @entry = entry
138
-
139
137
  super(built_error)
140
138
  end
141
139
 
@@ -84,16 +84,20 @@ module Eco
84
84
  entries.each_with_object([]) do |entry, arr|
85
85
  response = status[entry]
86
86
  if body = response.body
87
+ errs = []
87
88
  if errs = body["errors"] || body["error"]
88
89
  errs = [errs].flatten(1).compact
89
- errs.each do |msg|
90
- arr.push(ErrorCache.new(
91
- klass = Eco::API::Error.get_type(msg),
92
- klass.new(err_msg: msg, entry: entry, session: session),
93
- entry,
94
- response
95
- ))
96
- end
90
+ end
91
+ if errs.empty? && !response.success?
92
+ errs = [body["response"]].flatten(1).compact
93
+ end
94
+ errs.each do |msg|
95
+ arr.push(ErrorCache.new(
96
+ klass = Eco::API::Error.get_type(msg),
97
+ klass.new(err_msg: msg, entry: entry, session: session),
98
+ entry,
99
+ response
100
+ ))
97
101
  end
98
102
  end
99
103
  end
@@ -185,7 +189,6 @@ module Eco
185
189
  logger.error(str(key))
186
190
  end
187
191
  end
188
-
189
192
  end
190
193
  end
191
194
  end
@@ -396,7 +396,6 @@ module Eco
396
396
  subjobs.add(subjob, &block)
397
397
  end
398
398
  end
399
-
400
399
  end
401
400
  end
402
401
  end
data/lib/eco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = "2.1.9"
2
+ VERSION = "2.1.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eco-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.9
4
+ version: 2.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura