devo-ps/dopy — pull request #1 by neomantra (2013-07-01 15:54:06+00:00)
Title: Enhance error handling

Although the DigitalOcean API spec says that the error message will be in
the field 'message', I was getting some in the field 'error_message'. This
was happening with a HTTP error code of 404 so the current code was not
catching it.

The `raise DoError(json['message')` actually raised an exception, namely
`KeyError: message`. In the Ansible module, this was giving the very
unhelpful error `{ "failed": true, "msg": "message" }`.

This commit adds some error handling to the error handling.