# File lib/awsbase/right_awsbase.rb, line 785
        def self.on_aws_exception(aws, options={:raise=>true, :log=>true})
            # Only log & notify if not user error
            if !options[:raise] || system_error?($!)
                error_text = "#{$!.inspect}\n#{$@}.join('\n')}"
                puts error_text if options[:puts]
                # Log the error
                if options[:log]
                    request = aws.last_request ? aws.last_request.path : '-none-'
                    response = aws.last_response ? "#{aws.last_response.code} -- #{aws.last_response.message} -- #{aws.last_response.body}" : '-none-'
                    @response = response
                    aws.logger.error error_text
                    aws.logger.error "Request was:  #{request}"
                    aws.logger.error "Response was: #{response}"
                end
            end
            raise if options[:raise] # re-raise an exception
            return nil
        end