Exception: Authlete::Exception

Inherits:
StandardError
  • Object
show all
Includes:
ParamInitializer
Defined in:
lib/authlete/exception.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#messageObject

Returns the value of attribute message.



22
23
24
# File 'lib/authlete/exception.rb', line 22

def message
  @message
end

#resultObject

Returns the value of attribute result.



28
29
30
# File 'lib/authlete/exception.rb', line 28

def result
  @result
end

#statusCodeObject Also known as: status_code

Returns the value of attribute statusCode.



24
25
26
# File 'lib/authlete/exception.rb', line 24

def statusCode
  @statusCode
end

Class Method Details

.default_messageObject



65
66
67
# File 'lib/authlete/exception.rb', line 65

def self.default_message
  self.name
end

Instance Method Details

#available_messageObject



56
57
58
# File 'lib/authlete/exception.rb', line 56

def available_message
  result_message || @message || self.class.default_message
end

#result_codeObject



48
49
50
# File 'lib/authlete/exception.rb', line 48

def result_code
  @result && @result.resultCode
end

#result_messageObject



52
53
54
# File 'lib/authlete/exception.rb', line 52

def result_message
  @result && @result.resultMessage
end

#to_sObject



60
61
62
63
# File 'lib/authlete/exception.rb', line 60

def to_s
  "#{self.class.default_message} => { message:'#{@message}', status_code:'#{@statusCode}', " +
  "result_code:'#{result_code}', result_message:'#{result_message}' }"
end