hellosign-ruby-sdk 3.6.1 → 3.6.2

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: 9a8ba883a4aa8b3dc4bbefcd44233f4a5ced8219
4
- data.tar.gz: 4dd9fd6acdf226d24d85a9cbad67d5ab0fef64a2
3
+ metadata.gz: b11317ed4e1e95a527c5d32b78a4cc062a4a91e6
4
+ data.tar.gz: 4ac3eda0924a480bfa5084de4e16e92dd5f5389d
5
5
  SHA512:
6
- metadata.gz: 6c80dd7943e1ed648a7ade44e4d515bf69db9fd27ecbfb92f8a761634f3e957fae7c3ba6f592558ad65b342f9e038d7b3e03e7a8e742495fc767dfbb7c5e41d3
7
- data.tar.gz: adc12154ca8a5faa84ade9bf9644ead026e03ef7db3b9e6e9b65995d90b0e6ac96eb1a889db411e000df902316b0006aace883ad7d004dbc52974fa5dcdde045
6
+ metadata.gz: f5a6cb919a182c40c9e2a5cf94d7d1afa0d1a80eaa7496bef9e54a14b2e109c3ec52c1b43b7a9ee2e93ce4c4780c89578b0268075596bec0bd8ac4e578c0f4e1
7
+ data.tar.gz: 4413a6ff196d6f2b11d28c25290a9d0003e65d761a4a7c6c74daa607369bf5e1a380c5be8de4a57f35cdde4ff7c38b3d79817bf93b4f83ba4be3279569e86d4f
@@ -178,10 +178,10 @@ module HelloSign
178
178
  def validate(response)
179
179
  if response.status >= 400
180
180
  error_class = ERRORS[response.status] || HelloSign::Error::UnknownError
181
- error = error_class.new
182
- error.response_status = response.status
183
- error.response_body = response.body
184
- error.request_uri = response.to_hash[:url].to_s
181
+ error = error_class.new(response.status, response.body, response.to_hash[:url].to_s)
182
+ # error.response_status = response.status
183
+ # error.response_body = response.body
184
+ # error.request_uri = response.to_hash[:url].to_s
185
185
  raise error
186
186
  end
187
187
  end
@@ -26,19 +26,20 @@ module HelloSign
26
26
  module Error
27
27
  # Custom error class for rescuing from all HelloSign errors.
28
28
  class Error < StandardError;
29
- attr_accessor :request_uri
30
- attr_accessor :response_body
31
- attr_accessor :response_status
29
+ attr_accessor :request_uri, :response_body, :response_status
32
30
 
33
- def initialize(message = nil)
34
- super(message || human_readable_message)
31
+ def initialize(response_status, response_body = nil, request_uri)
32
+ @request_uri = request_uri
33
+ @response_body = response_body
34
+ @response_status = response_status
35
+ super(human_readable_message)
35
36
  end
36
37
 
37
38
  private
38
39
  def human_readable_message
39
- "Server responded with code #{response_status}\n" \
40
- "Request URI: #{request_uri}\n"\
41
- "Message: #{response_body}"
40
+ "Server responded with code #{@response_status}\n" \
41
+ "Request URI: #{@request_uri}\n"\
42
+ "Message: #{@response_body}"
42
43
  end
43
44
  end
44
45
 
@@ -23,5 +23,5 @@
23
23
  #
24
24
 
25
25
  module HelloSign
26
- VERSION = '3.6.1'
26
+ VERSION = '3.6.2'
27
27
  end
@@ -2,9 +2,9 @@ require 'spec_helper'
2
2
 
3
3
  describe HelloSign::Error do
4
4
  # another test to prove backwards compatibility
5
- describe 'custom error message' do
6
- subject { HelloSign::Error::Error.new('Foo').message }
7
- it { is_expected.to eql('Foo') }
5
+ it 'raises an error with any message' do
6
+ error = HelloSign::Error::Error.new(404, 'test error message', 'http://www.test.com')
7
+ expect(error).to be_instance_of(HelloSign::Error::Error)
8
8
  end
9
- end
10
9
 
10
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hellosign-ruby-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.1
4
+ version: 3.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - HelloSign
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-13 00:00:00.000000000 Z
11
+ date: 2018-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler