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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec9e9cb1593b5c52d89bee2c12f090e44a7971da
4
- data.tar.gz: e06fd6194e21b77345da0f6161ee39933ba83a55
3
+ metadata.gz: dcc3c764f74e351a63fd14ff47ccf24960fa1682
4
+ data.tar.gz: 03003ea0a497c6823a25b61f7c9f95b5e63cccc6
5
5
  SHA512:
6
- metadata.gz: 0af1edd67694efcb5481a46cf113a8b2668aea7a2cd3108e57035361a623f2516eeab46c938819d6f67b53c736a2a0ebb71a5d03671b75800be380203aba728c
7
- data.tar.gz: 162c245cbe197b54872cf801f43ec1a7e090ee40c8779ae060a83665911340fad3bb0e9b89189f5fa94ea4e8f3da7ef61f4492cec5210ec206eb209f5394dd3d
6
+ metadata.gz: bea2ce89ada7266e4c9e34c2e3e8c37e76942dbcd9754c7560242ec280541d072cb6a2bfb398b62e5711c21379599be0ba9edcfe9d1d1130ecb27158ab08589e
7
+ data.tar.gz: 1313bcf0d0a1ffd99ec015cbd82f2812713b2f9c96c6dd16c33d57224d660fb8a62333182d159b38fe554f2657d4af3464016250a4ae3edd015cef7ef333599d
@@ -38,12 +38,23 @@ module SoapyCake
38
38
  end
39
39
 
40
40
  def check_errors!
41
- fault = sax.for_tag(:fault).first
42
- fail RequestFailed, fault[:reason][:text] if fault
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
- fail RequestFailed, error_message unless sax.for_tag(:success).first == 'true'
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?
@@ -1,3 +1,3 @@
1
1
  module SoapyCake
2
- VERSION = '1.13.0'
2
+ VERSION = '1.13.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soapy_cake
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ad2games GmbH