fog/fog — pull request #1935 by jbence (2013-07-03 05:49:20+00:00)
Title: [aws] Update aws error handling

Recent changes in one or more of fog/excon/AWS has resulted in less informative exceptions. The symptom is that the caller will receive an Excon::Errors::HTTPStatusError with a message, e.g., "Expected(200) <=> Actual(400 Bad Request)". The root cause is obscured and there are multiple reasons a 400 might be raised.

This pull request introduces a method which examines the HTTPStatusError raised by excon and extracts details used to raise an appropriate exception. It examines, in order, error.message and error.response.body for the details; the old implementation looked only at error.message.

Some minor refactoring is included in the code that selects the exception to raise.

These changes have been made to: auto_scaling, beanstalk, cloud_formation, compute, elasticache, elb, iam, rds, and sts.