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 +4 -4
- data/lib/drntest/response-normalizer.rb +9 -5
- data/lib/drntest/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d31944a909862aa00b606d449ea226c0dce448e5
|
4
|
+
data.tar.gz: 87a72b69c7c79df457a39e3569ce8d04787ab805
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
86
|
-
case
|
89
|
+
def normalize_error_body!(body)
|
90
|
+
case body["name"]
|
87
91
|
when "InvalidValue"
|
88
|
-
message =
|
92
|
+
message = body["message"]
|
89
93
|
message = message.lines.first.chomp
|
90
94
|
message = message.gsub(/\#<(Groonga::[a-zA-Z]+) .*>\z/, "\#<\\1 ...>")
|
91
|
-
|
95
|
+
body["message"] = message
|
92
96
|
end
|
93
97
|
end
|
94
98
|
|
data/lib/drntest/version.rb
CHANGED