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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea2abaaf26962b06ad6784e3a5bf6b8c35938583
4
- data.tar.gz: 7b44f08e0fdca2b1dc01d937748ebcd92744398d
3
+ metadata.gz: 39981156aa20418b3109add8e3d94c63077bd44c
4
+ data.tar.gz: 50e5710aa809acc6203119011b706034fbdd100f
5
5
  SHA512:
6
- metadata.gz: 2156ffdda7698d7240cca625014316740592fb13cd616752f2e9df6007a2e10a8b766261e23cfe9aebebeeee3acb1da0f3b6cb9697139509dbe71f087899f5b0
7
- data.tar.gz: 206dd6ed1d24f615ec08859b004e2ae5dbb11a186ef9f518a43dbeda6e78d12fe62518726e86d5e998354e99a693671bcd47c6b9728fbf1f073f55612ae45f72
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
@@ -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; 'Malformed response'; end
15
+ def error_message
16
+ "Malformed response: #{@error_message}"
17
+ end
14
18
  end
@@ -1,3 +1,3 @@
1
1
  class Gillbus
2
- VERSION = '0.17.5'.freeze
2
+ VERSION = '0.17.6'.freeze
3
3
  end
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.5
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-25 00:00:00.000000000 Z
12
+ date: 2018-04-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport