1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[aws|rds] Fix exception for missing DB security groups

RDS#describe_db_instances('no-such-group') raises
  Fog::AWS::RDS::NotFound
instead of
  Excon::Errors::NotFound
This commit is contained in:
Aaron Suggs 2011-04-11 16:02:59 -04:00
parent 4d1fc17bc6
commit 84b0fb4d2d

View file

@ -140,7 +140,7 @@ module Fog
rescue Excon::Errors::HTTPStatusError => error rescue Excon::Errors::HTTPStatusError => error
if match = error.message.match(/<Code>(.*)<\/Code>[\s\\\w]+<Message>(.*)<\/Message>/m) if match = error.message.match(/<Code>(.*)<\/Code>[\s\\\w]+<Message>(.*)<\/Message>/m)
case match[1].split('.').last case match[1].split('.').last
when 'DBInstanceNotFound', 'DBParameterGroupNotFound', 'DBSnapshotNotFound' when 'DBInstanceNotFound', 'DBParameterGroupNotFound', 'DBSnapshotNotFound', 'DBSecurityGroupNotFound'
raise Fog::AWS::RDS::NotFound.slurp(error, match[2]) raise Fog::AWS::RDS::NotFound.slurp(error, match[2])
when 'DBParameterGroupAlreadyExists' when 'DBParameterGroupAlreadyExists'
raise Fog::AWS::RDS::IdentifierTaken.slurp(error, match[2]) raise Fog::AWS::RDS::IdentifierTaken.slurp(error, match[2])