mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Change to use new Excon::Errors::HTTPStatusError class
This commit is contained in:
parent
6d908f888b
commit
ee4f95e4ce
8 changed files with 8 additions and 8 deletions
|
@ -219,7 +219,7 @@ module Fog
|
||||||
:method => 'POST',
|
:method => 'POST',
|
||||||
:parser => parser
|
:parser => parser
|
||||||
})
|
})
|
||||||
rescue Excon::Errors::Error => error
|
rescue Excon::Errors::HTTPStatusError => error
|
||||||
if match = error.message.match(/<Code>(.*)<\/Code><Message>(.*)<\/Message>/)
|
if match = error.message.match(/<Code>(.*)<\/Code><Message>(.*)<\/Message>/)
|
||||||
raise case match[1].split('.').last
|
raise case match[1].split('.').last
|
||||||
when 'NotFound'
|
when 'NotFound'
|
||||||
|
|
|
@ -68,7 +68,7 @@ module Fog
|
||||||
|
|
||||||
begin
|
begin
|
||||||
response = @connection.request(params.merge!({:host => @host}))
|
response = @connection.request(params.merge!({:host => @host}))
|
||||||
rescue Excon::Errors::Error => error
|
rescue Excon::Errors::HTTPStatusError => error
|
||||||
raise case error
|
raise case error
|
||||||
when Excon::Errors::NotFound
|
when Excon::Errors::NotFound
|
||||||
Fog::Bluebox::Compute::NotFound.slurp(error)
|
Fog::Bluebox::Compute::NotFound.slurp(error)
|
||||||
|
|
|
@ -81,7 +81,7 @@ module Fog
|
||||||
response = @connection.request(
|
response = @connection.request(
|
||||||
params.merge!(:path => "#{@path}/#{params[:path]}")
|
params.merge!(:path => "#{@path}/#{params[:path]}")
|
||||||
)
|
)
|
||||||
rescue Excon::Errors::Error => error
|
rescue Excon::Errors::HTTPStatusError => error
|
||||||
raise case error
|
raise case error
|
||||||
when Excon::Errors::NotFound
|
when Excon::Errors::NotFound
|
||||||
Fog::GoGrid::Compute::NotFound.slurp(error)
|
Fog::GoGrid::Compute::NotFound.slurp(error)
|
||||||
|
|
|
@ -70,7 +70,7 @@ module Fog
|
||||||
|
|
||||||
begin
|
begin
|
||||||
response = @connection.request(params.merge!({:host => @host}))
|
response = @connection.request(params.merge!({:host => @host}))
|
||||||
rescue Excon::Errors::Error => error
|
rescue Excon::Errors::HTTPStatusError => error
|
||||||
raise case error
|
raise case error
|
||||||
when Excon::Errors::NotFound
|
when Excon::Errors::NotFound
|
||||||
Fog::NewServers::Compute::NotFound.slurp(error)
|
Fog::NewServers::Compute::NotFound.slurp(error)
|
||||||
|
|
|
@ -61,7 +61,7 @@ module Fog
|
||||||
:host => @host,
|
:host => @host,
|
||||||
:path => "#{@path}/#{params[:path]}",
|
:path => "#{@path}/#{params[:path]}",
|
||||||
}))
|
}))
|
||||||
rescue Excon::Errors::Error => error
|
rescue Excon::Errors::HTTPStatusError => error
|
||||||
raise case error
|
raise case error
|
||||||
when Excon::Errors::NotFound
|
when Excon::Errors::NotFound
|
||||||
Fog::Rackspace::Storage::NotFound.slurp(error)
|
Fog::Rackspace::Storage::NotFound.slurp(error)
|
||||||
|
|
|
@ -92,7 +92,7 @@ module Fog
|
||||||
:host => @host,
|
:host => @host,
|
||||||
:path => "#{@path}/#{params[:path]}"
|
:path => "#{@path}/#{params[:path]}"
|
||||||
}))
|
}))
|
||||||
rescue Excon::Errors::Error => error
|
rescue Excon::Errors::HTTPStatusError => error
|
||||||
raise case error
|
raise case error
|
||||||
when Excon::Errors::NotFound
|
when Excon::Errors::NotFound
|
||||||
Fog::Rackspace::Compute::NotFound.slurp(error)
|
Fog::Rackspace::Compute::NotFound.slurp(error)
|
||||||
|
|
|
@ -111,7 +111,7 @@ module Fog
|
||||||
:host => @host,
|
:host => @host,
|
||||||
:path => "#{@path}/#{params[:path]}",
|
:path => "#{@path}/#{params[:path]}",
|
||||||
}), &block)
|
}), &block)
|
||||||
rescue Excon::Errors::Error => error
|
rescue Excon::Errors::HTTPStatusError => error
|
||||||
raise case error
|
raise case error
|
||||||
when Excon::Errors::NotFound
|
when Excon::Errors::NotFound
|
||||||
Fog::Rackspace::Storage::NotFound.slurp(error)
|
Fog::Rackspace::Storage::NotFound.slurp(error)
|
||||||
|
|
|
@ -73,7 +73,7 @@ module Fog
|
||||||
|
|
||||||
begin
|
begin
|
||||||
response = @connection.request(params.merge!({:host => @host}))
|
response = @connection.request(params.merge!({:host => @host}))
|
||||||
rescue Excon::Errors::Error => error
|
rescue Excon::Errors::HTTPStatusError => error
|
||||||
raise case error
|
raise case error
|
||||||
when Excon::Errors::NotFound
|
when Excon::Errors::NotFound
|
||||||
Fog::Slicehost::Compute::NotFound.slurp(error)
|
Fog::Slicehost::Compute::NotFound.slurp(error)
|
||||||
|
|
Loading…
Reference in a new issue