Class: SynapseClient::Error
- Inherits:
-
Object
- Object
- SynapseClient::Error
- Defined in:
- lib/synapse_client/error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(exception, request) ⇒ Error
constructor
A new instance of Error.
- #msg ⇒ Object
Constructor Details
#initialize(exception, request) ⇒ Error
Returns a new instance of Error.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/synapse_client/error.rb', line 11 def initialize(exception, request) @exception = exception @request = request # begin @message = @exception["reason"] || @exception["message"] @title = @exception["title"] rescue => e # FIXME # Rails.logger.error("Something went wrong with interacting with Synapse: #{ @exception.message }") return end # if @message.present? && @message.match(/error.*oauth.*authentication/i).present? refreshed_tokens = SynapseClient::RefreshedTokens.new({ :old_access_token => @request.customer_access_token, :old_refresh_token => @request.customer_refresh_token }) refreshed_tokens.refresh_old_tokens end end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
7 8 9 |
# File 'lib/synapse_client/error.rb', line 7 def code @code end |
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
8 9 10 |
# File 'lib/synapse_client/error.rb', line 8 def exception @exception end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/synapse_client/error.rb', line 5 def @message end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
9 10 11 |
# File 'lib/synapse_client/error.rb', line 9 def request @request end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/synapse_client/error.rb', line 6 def title @title end |
Instance Method Details
#msg ⇒ Object
37 38 39 |
# File 'lib/synapse_client/error.rb', line 37 def msg (title || ).to_s end |