Exception: SparkApi::ClientError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/spark_api/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ClientError

Returns a new instance of ClientError.



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/spark_api/errors.rb', line 25

def initialize (options = {})
  # Support the standard initializer for errors
  opts = options.is_a?(Hash) ? options : {:message => options.to_s}
  @code = opts[:code]
  @status = opts[:status]
  @details = opts[:details]
  @request_path = opts[:request_path]
  @request_id = opts[:request_id]
  @errors = opts[:errors]
  super(opts[:message])
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



24
25
26
# File 'lib/spark_api/errors.rb', line 24

def code
  @code
end

#detailsObject (readonly)

Returns the value of attribute details.



24
25
26
# File 'lib/spark_api/errors.rb', line 24

def details
  @details
end

#errorsObject (readonly)

Returns the value of attribute errors.



24
25
26
# File 'lib/spark_api/errors.rb', line 24

def errors
  @errors
end

#request_idObject (readonly)

Returns the value of attribute request_id.



24
25
26
# File 'lib/spark_api/errors.rb', line 24

def request_id
  @request_id
end

#request_pathObject (readonly)

Returns the value of attribute request_path.



24
25
26
# File 'lib/spark_api/errors.rb', line 24

def request_path
  @request_path
end

#statusObject (readonly)

Returns the value of attribute status.



24
25
26
# File 'lib/spark_api/errors.rb', line 24

def status
  @status
end