Exception: IntuitOAuth::OAuth2ClientException
- Inherits:
-
StandardError
- Object
- StandardError
- IntuitOAuth::OAuth2ClientException
- Defined in:
- lib/intuit-oauth/exception.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#intuit_tid ⇒ Object
readonly
Returns the value of attribute intuit_tid.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(response) ⇒ OAuth2ClientException
constructor
A new instance of OAuth2ClientException.
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
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/intuit-oauth/exception.rb', line 3 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
3 4 5 |
# File 'lib/intuit-oauth/exception.rb', line 3 def headers @headers end |
#intuit_tid ⇒ Object (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_code ⇒ Object (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 |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
3 4 5 |
# File 'lib/intuit-oauth/exception.rb', line 3 def @timestamp end |