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 +1 -1
- data/excon.gemspec +2 -2
- data/lib/excon/connection.rb +1 -1
- data/lib/excon/errors.rb +3 -3
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/excon.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{excon}
|
8
|
-
s.version = "0.0.
|
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-
|
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 = [
|
data/lib/excon/connection.rb
CHANGED
@@ -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
|
86
|
+
raise(Excon::Errors.status_error(params, response))
|
87
87
|
else
|
88
88
|
response
|
89
89
|
end
|
data/lib/excon/errors.rb
CHANGED
@@ -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(
|
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[
|
90
|
-
error
|
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
|
+
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-
|
12
|
+
date: 2009-11-17 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|