gillbus 0.17.5 → 0.17.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gillbus/base_response.rb +3 -3
- data/lib/gillbus/parse_error.rb +6 -2
- data/lib/gillbus/version.rb +1 -1
- data/test/error_test.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39981156aa20418b3109add8e3d94c63077bd44c
|
4
|
+
data.tar.gz: 50e5710aa809acc6203119011b706034fbdd100f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 512923d49ef42592d7f3d1d2fbd4a6e97b888d15980cd1b1ebeee82ded1908cda2fa820e07d8a2769ebf797f2557e7d8beb1395e34dee02f54298705d2c2f4ab
|
7
|
+
data.tar.gz: 15d286724cead0805000c7d4d29c9abea2f7b59ca11561bc8cc6515a2e037cf616df9cbfa6284d9f90c418723de581c00ef6b3ad7d95add3171a6cb0a11c261d
|
@@ -34,11 +34,11 @@ class Gillbus
|
|
34
34
|
def self.parse_string(xml_string, **options)
|
35
35
|
xml = MultiXml.parse(xml_string)
|
36
36
|
# <DATA/> is a valid response
|
37
|
-
return ParseError.new(xml_string) unless xml.key?('DATA')
|
37
|
+
return ParseError.new(xml_string, 'DATA attribute missing') unless xml.key?('DATA')
|
38
38
|
data = xml['DATA'] || {}
|
39
39
|
parse(data, instance: new, options: options)
|
40
|
-
rescue MultiXml::ParseError, ArgumentError
|
41
|
-
ParseError.new(xml_string)
|
40
|
+
rescue MultiXml::ParseError, ArgumentError => e
|
41
|
+
ParseError.new(xml_string, e.message)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
data/lib/gillbus/parse_error.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# I want it not to be an exception, for now
|
2
2
|
class Gillbus::ParseError
|
3
|
-
def initialize(response_string)
|
3
|
+
def initialize(response_string, error_message)
|
4
4
|
@response = response_string
|
5
|
+
@error_message = error_message
|
5
6
|
end
|
7
|
+
|
6
8
|
attr_reader :response
|
7
9
|
attr_accessor :session_id
|
8
10
|
attr_accessor :request_time
|
@@ -10,5 +12,7 @@ class Gillbus::ParseError
|
|
10
12
|
|
11
13
|
def error_code; 0; end
|
12
14
|
|
13
|
-
def error_message
|
15
|
+
def error_message
|
16
|
+
"Malformed response: #{@error_message}"
|
17
|
+
end
|
14
18
|
end
|
data/lib/gillbus/version.rb
CHANGED
data/test/error_test.rb
CHANGED
@@ -22,6 +22,7 @@ class ErrorTest < Minitest::Test
|
|
22
22
|
|
23
23
|
def test_malformed_errorness
|
24
24
|
assert malformed_response.error?
|
25
|
+
assert_equal "Malformed response: Not Terminated: text not terminated at 0:10", malformed_response.error_message
|
25
26
|
end
|
26
27
|
|
27
28
|
def test_malformed_2_errorness
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gillbus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey "codesnik" Trofimenko
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-04-
|
12
|
+
date: 2018-04-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|