'call fail_json with processed exception
function for converting exceptions thrown by AWS SDK modules,
botocore, boto3 and boto, into nice error messages.'

def fail_json_aws(self, exception, msg=None):

    last_traceback = traceback.format_exc()
    try:
        except_msg = to_native(exception.message)
    except AttributeError:
        except_msg = to_native(exception)
    if (msg is not None):
        message = '{0}:    {1}'.format(msg, except_msg)
    else:
        message = except_msg
    try:
        response = exception.response
    except AttributeError:
        response = None
    if (response is None):
        self._module.fail_json(msg=message, exception=last_traceback)
    else:
        self._module.fail_json(msg=message, exception=last_traceback, **camel_dict_to_snake_dict(response))
