Exception: PrivateCaptcha::HTTPError

Inherits:
Error
  • Object
show all
Defined in:
lib/private_captcha/errors.rb

Overview

HTTPError is raised when an HTTP error occurs during verification

Instance Attribute Summary collapse

Attributes inherited from Error

#trace_id

Instance Method Summary collapse

Constructor Details

#initialize(status_code, seconds = nil, trace_id: nil) ⇒ HTTPError

Returns a new instance of HTTPError.



32
33
34
35
36
# File 'lib/private_captcha/errors.rb', line 32

def initialize(status_code, seconds = nil, trace_id: nil)
  @status_code = status_code
  @seconds = seconds
  super("HTTP error #{status_code}", trace_id: trace_id)
end

Instance Attribute Details

#secondsObject (readonly)

Returns the value of attribute seconds.



30
31
32
# File 'lib/private_captcha/errors.rb', line 30

def seconds
  @seconds
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



30
31
32
# File 'lib/private_captcha/errors.rb', line 30

def status_code
  @status_code
end