Exception: RubyCord::CloudFlareBanError

Inherits:
HTTPError show all
Defined in:
lib/rubycord/error.rb

Overview

Represents a error because of a cloudflare ban.

Instance Attribute Summary

Attributes inherited from HTTPError

#code, #response

Instance Method Summary collapse

Constructor Details

#initialize(_resp, client) ⇒ CloudFlareBanError

Returns a new instance of CloudFlareBanError.



100
101
102
103
104
105
106
107
108
109
# File 'lib/rubycord/error.rb', line 100

def initialize(_resp, client)
  @client = client
  @client.close
  message = <<~MESSAGE
    The client is banned from CloudFlare.
    Hint: Try to decrease the number of requests per second, e.g. Use sleep in between requests.
  MESSAGE
  warn message
  DiscorbError.instance_method(:initialize).bind(self).call(message)
end