Exception: Discorb::CloudFlareBanError

Inherits:
HTTPError show all
Defined in:
lib/discorb/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.



86
87
88
89
90
91
92
93
# File 'lib/discorb/error.rb', line 86

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