lib/kakine/adapter/real.rb in kakine-0.6.0 vs lib/kakine/adapter/real.rb in kakine-0.6.1
- old
+ new
@@ -4,12 +4,12 @@
include Kakine::Adapter::Base
def create_rule(security_group_id, direction, security_rule)
begin
security_rule = symbolized_rule(security_rule)
Yao::SecurityGroupRule.create(security_rule.merge({'security_group_id' => security_group_id, 'direction' => direction}))
- rescue Excon::Errors::Conflict, Excon::Errors::BadRequest => e
- error_message(e.response[:body])
+ rescue Yao::Conflict, Yao::BadRequest => e
+ error_message(e.message)
rescue Kakine::SecurityRuleError => e
puts e
end
end
@@ -19,19 +19,19 @@
def create_security_group(attributes)
begin
security_group = Yao::SecurityGroup.create(symbolized_group(attributes))
{"id" => security_group.id}
- rescue Excon::Errors::Conflict, Excon::Errors::BadRequest => e
- error_message(e.response[:body])
+ rescue Yao::Conflict, Yao::BadRequest => e
+ error_message(e.message)
end
end
def delete_security_group(security_group_id)
begin
Yao::SecurityGroup.destroy(security_group_id)
- rescue Excon::Errors::Conflict, Excon::Errors::BadRequest => e
- error_message(e.response[:body])
+ rescue Yao::Conflict, Yao::BadRequest => e
+ error_message(e.message)
end
end
private