Exception: IntuitOAuth::OAuth2ClientException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/intuit-oauth/exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ OAuth2ClientException

Returns a new instance of OAuth2ClientException.



5
6
7
8
9
10
11
12
# File 'lib/intuit-oauth/exception.rb', line 5

def initialize(response)
  @status_code = response.code
  @body = response.body
  @headers = response.headers
  @intuit_tid = response.headers['intuit_tid']
  @timestamp = response.headers['date']
  super("HTTP status #{@status_code}, error message: #{@body}, intuit_tid: #{@intuit_tid} on #{@timestamp}")
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



3
4
5
# File 'lib/intuit-oauth/exception.rb', line 3

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



3
4
5
# File 'lib/intuit-oauth/exception.rb', line 3

def headers
  @headers
end

#intuit_tidObject (readonly)

Returns the value of attribute intuit_tid.



3
4
5
# File 'lib/intuit-oauth/exception.rb', line 3

def intuit_tid
  @intuit_tid
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



3
4
5
# File 'lib/intuit-oauth/exception.rb', line 3

def status_code
  @status_code
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



3
4
5
# File 'lib/intuit-oauth/exception.rb', line 3

def timestamp
  @timestamp
end