Exception: ThinkificRuby::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- ThinkificRuby::ApiError
- Defined in:
- lib/thinkific_ruby/api_error.rb
Constant Summary collapse
- DEFAULT_MSG =
"There was an error with your API request. Check the status code and response_body for details."
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(status_code, response, msg = DEFAULT_MSG) ⇒ ApiError
constructor
we’ll still give it an optional error message, but leave it as the default which will tell them to check the status and body in the error object.
Constructor Details
#initialize(status_code, response, msg = DEFAULT_MSG) ⇒ ApiError
we’ll still give it an optional error message, but leave it as the default which will tell them to check the status and body in the error object
9 10 11 12 13 14 |
# File 'lib/thinkific_ruby/api_error.rb', line 9 def initialize(status_code, response, msg=DEFAULT_MSG) @status_code = status_code @response = response super(msg) end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/thinkific_ruby/api_error.rb', line 4 def response @response end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
3 4 5 |
# File 'lib/thinkific_ruby/api_error.rb', line 3 def status_code @status_code end |