soapy_cake 1.13.0 → 1.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/soapy_cake/response.rb +14 -3
- data/lib/soapy_cake/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: dcc3c764f74e351a63fd14ff47ccf24960fa1682
|
4
|
+
data.tar.gz: 03003ea0a497c6823a25b61f7c9f95b5e63cccc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bea2ce89ada7266e4c9e34c2e3e8c37e76942dbcd9754c7560242ec280541d072cb6a2bfb398b62e5711c21379599be0ba9edcfe9d1d1130ecb27158ab08589e
|
7
|
+
data.tar.gz: 1313bcf0d0a1ffd99ec015cbd82f2812713b2f9c96c6dd16c33d57224d660fb8a62333182d159b38fe554f2657d4af3464016250a4ae3edd015cef7ef333599d
|
data/lib/soapy_cake/response.rb
CHANGED
@@ -38,12 +38,23 @@ module SoapyCake
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def check_errors!
|
41
|
-
|
42
|
-
|
41
|
+
# If we get a lot of data in our response, we can assume there was no error.
|
42
|
+
# This saves a lot of time because we don't have to scan the whole XML tree for errors.
|
43
|
+
return if body.length > 8192
|
43
44
|
|
45
|
+
error_check_fault!
|
44
46
|
return if error_check_special_case?
|
47
|
+
error_check_success!
|
48
|
+
end
|
49
|
+
|
50
|
+
def error_check_fault!
|
51
|
+
fault = sax.for_tag(:fault).first
|
52
|
+
fail RequestFailed, fault[:reason][:text] if fault
|
53
|
+
end
|
45
54
|
|
46
|
-
|
55
|
+
def error_check_success!
|
56
|
+
return if sax.for_tag(:success).first == 'true'
|
57
|
+
fail RequestFailed, error_message
|
47
58
|
end
|
48
59
|
|
49
60
|
def error_check_special_case?
|
data/lib/soapy_cake/version.rb
CHANGED