drntest 1.1.8 → 1.1.9

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
  SHA1:
3
- metadata.gz: 22d9861eb68606fc7f21c98ed259719b9a51412a
4
- data.tar.gz: f8b4225dc6c33436455f064c0a608767207c2104
3
+ metadata.gz: d31944a909862aa00b606d449ea226c0dce448e5
4
+ data.tar.gz: 87a72b69c7c79df457a39e3569ce8d04787ab805
5
5
  SHA512:
6
- metadata.gz: b2c07f1823b51ee9c1ef76db7f68afeeaeae0e7c1f5a96648073c61ecaa61ac62e245d7d91b64b12005afb1d15ed59303b2e4452445cd56fd491a686bac1d1c4
7
- data.tar.gz: d671572c7f581f2f2a760882bee477b9afbafaa7196560b1db4bcbb490eec347fa78c13b02405e8641d51f86e9508df36196950b92bda2478776a65457d8e690
6
+ metadata.gz: ec0642a7e4af6688491e30a1754f5c71d48cdc5c8392499dedeccd23532e934c503c5f2d749943c696ebf304495c1a8948861a5a7b0b809335784600642498ee
7
+ data.tar.gz: be5b39894f8844cd6f26ced91b370e4dec9bff201a7bdf5d524601ca49e6812c187a05d92f59631375414c9284186b5710c9543e8eb4d330c2a2d4f815f4c86b
@@ -66,6 +66,10 @@ module Drntest
66
66
  in_reply_to = message["inReplyTo"]
67
67
  message["inReplyTo"] = normalized_in_reply_to if in_reply_to
68
68
 
69
+ if message["statusCode"] != 200
70
+ normalize_error_body!(message["body"])
71
+ end
72
+
69
73
  errors = message["errors"]
70
74
  message["errors"] = normalize_errors(errors) if errors
71
75
  end
@@ -74,7 +78,7 @@ module Drntest
74
78
  normalized_errors = {}
75
79
  error_details = errors.values
76
80
  error_details.each do |error_detail|
77
- normalize_error_detail!(error_detail)
81
+ normalize_error_body!(error_detail["body"])
78
82
  end
79
83
  errors.keys.each_with_index do |source, index|
80
84
  normalized_errors["sources#{index}"] = error_details[index]
@@ -82,13 +86,13 @@ module Drntest
82
86
  normalized_errors
83
87
  end
84
88
 
85
- def normalize_error_detail!(error_detail)
86
- case error_detail["body"]["name"]
89
+ def normalize_error_body!(body)
90
+ case body["name"]
87
91
  when "InvalidValue"
88
- message = error_detail["body"]["message"]
92
+ message = body["message"]
89
93
  message = message.lines.first.chomp
90
94
  message = message.gsub(/\#<(Groonga::[a-zA-Z]+) .*>\z/, "\#<\\1 ...>")
91
- error_detail["body"]["message"] = message
95
+ body["message"] = message
92
96
  end
93
97
  end
94
98
 
@@ -14,5 +14,5 @@
14
14
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
16
  module Drntest
17
- VERSION = "1.1.8"
17
+ VERSION = "1.1.9"
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drntest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Droonga Project