lib/nsicloudooo/client.rb in nsicloudooo-0.3.0 vs lib/nsicloudooo/client.rb in nsicloudooo-0.3.1
- old
+ new
@@ -133,10 +133,17 @@
# Pre-configure the NSICloudooo module with default params for the NSICloudooo::Client
#
# @yield a Configuration object (see {NSICloudooo::Client::Configuration})
#
+ # @example
+ # NSICloudooo::Client.configure do
+ # user "why"
+ # password "chunky"
+ # host "localhost"
+ # port "8888"
+ # end
def self.configure(&block)
Configuration.instance_eval(&block)
end
private
@@ -168,9 +175,10 @@
raise NSICloudooo::Errors::Client::ConnectionRefusedError
else
raise NSICloudooo::Errors::Client::KeyNotFoundError if response.code == "404"
raise NSICloudooo::Errors::Client::MalformedRequestError if response.code == "400"
raise NSICloudooo::Errors::Client::AuthenticationError if response.code == "401"
+ raise NSICloudooo::Errors::Client::QueueServiceConnectionError if response.code == "503"
if response.code == "500" and response.body.include?("SAM")
raise NSICloudooo::Errors::Client::SAMConnectionError
end
JSON.parse(response.body)
end