excon 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of excon might be problematic. Click here for more details.

data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{excon}
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Wesley Beary"]
12
- s.date = %q{2009-11-14}
12
+ s.date = %q{2009-11-17}
13
13
  s.description = %q{speed, persistence, http(s)}
14
14
  s.email = %q{wbeary@engineyard.com}
15
15
  s.extra_rdoc_files = [
@@ -83,7 +83,7 @@ unless Excon.mocking?
83
83
  end
84
84
 
85
85
  if params[:expects] && ![*params[:expects]].include?(response.status)
86
- raise(Excon::Errors.status_error(params[:expects], response.status, response))
86
+ raise(Excon::Errors.status_error(params, response))
87
87
  else
88
88
  response
89
89
  end
@@ -44,7 +44,7 @@ module Excon
44
44
  class GatewayTimeout < Error; end # 504
45
45
 
46
46
  # Messages for nicer exceptions, from rfc2616
47
- def self.status_error(expected, actual, response)
47
+ def self.status_error(request, response)
48
48
  @errors ||= {
49
49
  100 => [Excon::Errors::Continue, 'Continue'],
50
50
  101 => [Excon::Errors::SwitchingProtocols, 'Switching Protocols'],
@@ -86,8 +86,8 @@ module Excon
86
86
  503 => [Excon::Errors::ServiceUnavailable, 'Service Unavailable'],
87
87
  504 => [Excon::Errors::GatewayTimeout, 'Gateway Timeout']
88
88
  }
89
- error = @errors[actual]
90
- error[0].new("Expected(#{expected.inspect}) <=> Actual(#{actual} #{error[1]}): #{response.body}")
89
+ error, message = @errors[response.status]
90
+ error.new("Expected(#{request[:expects]}) <=> Actual(#{response.status} #{message})\n request => #{request.inspect}\n response => #{response.inspect}")
91
91
  end
92
92
 
93
93
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wesley Beary
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-14 00:00:00 -08:00
12
+ date: 2009-11-17 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15