Exception: Calendly::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/calendly/api_error.rb

Overview

Calendly apis client error object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Loggable

#debug_log, #error_log, #info_log, #warn_log

Constructor Details

#initialize(response, cause_exception, message: nil) ⇒ ApiError

Returns a new instance of ApiError.



20
21
22
23
24
25
26
27
# File 'lib/calendly/api_error.rb', line 20

def initialize(response, cause_exception, message: nil)
  @response = response
  @cause_exception = cause_exception
  @message = message
  set_attributes_from_response
  @message ||= cause_exception.message if cause_exception
  super @message
end

Instance Attribute Details

#cause_exceptionOAuth2::Error, JSON::ParserError (readonly)

Returns:

  • (OAuth2::Error, JSON::ParserError)


18
19
20
# File 'lib/calendly/api_error.rb', line 18

def cause_exception
  @cause_exception
end

#responseFaraday::Response (readonly)

Returns:

  • (Faraday::Response)


9
10
11
# File 'lib/calendly/api_error.rb', line 9

def response
  @response
end

#statusInteger (readonly)

Returns:

  • (Integer)


12
13
14
# File 'lib/calendly/api_error.rb', line 12

def status
  @status
end

#titleString (readonly)

Returns:

  • (String)


15
16
17
# File 'lib/calendly/api_error.rb', line 15

def title
  @title
end

Instance Method Details

#inspectObject



29
30
31
# File 'lib/calendly/api_error.rb', line 29

def inspect
  "\#<#{self.class}:#{object_id} title:#{title}, status:#{status}>"
end