Exception: OpenID::ServerError

Inherits:
OpenIDError show all
Defined in:
lib/openid/kvpost.rb

Overview

Exception that is raised when the server returns a 400 response code to a direct request.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_text, error_code, message) ⇒ ServerError

Returns a new instance of ServerError.



10
11
12
13
14
15
# File 'lib/openid/kvpost.rb', line 10

def initialize(error_text, error_code, message)
  super(error_text)
  @error_text = error_text
  @error_code = error_code
  @message = message
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



8
9
10
# File 'lib/openid/kvpost.rb', line 8

def error_code
  @error_code
end

#error_textObject (readonly)

Returns the value of attribute error_text.



8
9
10
# File 'lib/openid/kvpost.rb', line 8

def error_text
  @error_text
end

#messageObject (readonly)

Returns the value of attribute message.



8
9
10
# File 'lib/openid/kvpost.rb', line 8

def message
  @message
end

Class Method Details

.from_message(msg) ⇒ Object



17
18
19
20
21
22
# File 'lib/openid/kvpost.rb', line 17

def self.from_message(msg)
  error_text = msg.get_arg(OPENID_NS, 'error',
                           '<no error message supplied>')
  error_code = msg.get_arg(OPENID_NS, 'error_code')
  return self.new(error_text, error_code, msg)
end