fog/fog — pull request #1689 by virtualstaticvoid (2013-03-22 09:48:39+00:00)
Title: Fix for AWS error message regex not matching `Code` correctly

The regular expression `(.*)<\/Code>(?:.*(.*)<\/Message>)` isn't matching the `Code` portion correctly in the error handling of `_request` methods of the various AWS classes.

As a consequence, the incorrect exception is raised from these methods. For example, the `get` method for users should return `nil` for a non-existent user, but instead `Fog::AWS::IAM::Error` is raised.

```ruby
iam = Fog::AWS::IAM.new({:provider => 'AWS', :aws_access_key_id => ACCESS_KEY_ID, :aws_secret_access_key => SECRET_ACCESS_KEY})
user = iam.users.get('non_existent_user')
user.should be_nil
```

I've looked at what has changed in Fog, excon and the AWS SDK to see why the regex used to work, but am unable to figure it out.

However, by changing to regex to match `(?:.*(.*)<\/Code>)(?:.*(.*)<\/Message>)` the error handling logic in [Fog::AWS:IAM::Real#_request](https://github.com/fog/fog/blob/master/lib/fog/aws/iam.rb#L197) works as expected.