Class: Parse::Error::CloudCodeError
- Inherits:
-
Error
- Object
- Error
- Parse::Error::CloudCodeError
- Defined in:
- lib/parse/client.rb
Overview
An error raised when a cloud function or job returns an error response (e.g. when the cloud code calls error!()). Carries the function name, Parse error code, HTTP status, and the underlying Response for debugging.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#function_name ⇒ Object
readonly
Returns the value of attribute function_name.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(function_name, response) ⇒ CloudCodeError
constructor
A new instance of CloudCodeError.
- #inspect ⇒ Object
Constructor Details
#initialize(function_name, response) ⇒ CloudCodeError
Returns a new instance of CloudCodeError.
99 100 101 102 103 104 105 |
# File 'lib/parse/client.rb', line 99 def initialize(function_name, response) @function_name = function_name @response = response @code = response.code @http_status = response.http_status super("Parse cloud function `#{function_name}` failed: [#{@code}] #{response.error} (HTTP #{@http_status})") end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
97 98 99 |
# File 'lib/parse/client.rb', line 97 def code @code end |
#function_name ⇒ Object (readonly)
Returns the value of attribute function_name.
97 98 99 |
# File 'lib/parse/client.rb', line 97 def function_name @function_name end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
97 98 99 |
# File 'lib/parse/client.rb', line 97 def http_status @http_status end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
97 98 99 |
# File 'lib/parse/client.rb', line 97 def response @response end |
Instance Method Details
#inspect ⇒ Object
107 108 109 |
# File 'lib/parse/client.rb', line 107 def inspect "#<#{self.class} function=#{@function_name.inspect} code=#{@code.inspect} http_status=#{@http_status.inspect}>" end |