class DeviantArt::Error
Attributes
:method: status_code
This is the HTTP status code of response.
:method: status_code
This is the HTTP status code of response.
:method: status_code
This is the HTTP status code of response.
:method: status_code
This is the HTTP status code of response.
:method: status_code
This is the HTTP status code of response.
Public Class Methods
DeviantArt::Base::new
# File lib/deviantart/error.rb, line 30 def initialize(json, status_code) super(json) @status_code = status_code end
Public Instance Methods
Error
type in JSON. For example: invalid_request
, unauthorized
and server_error
# File lib/deviantart/error.rb, line 5
Optional. Some endpoints may provide additional error codes so your application can provide fine grained handling of the error states. Each endpoint will define any additional codes in its documentation, all codes start from zero and are specific to that particular endpoint.
# File lib/deviantart/error.rb, line 18
The error message. You should NOT parse this as it may change, use error or error_code
for conditional logic within your app.
# File lib/deviantart/error.rb, line 9
Optional. For validation errors, this will be a key/value map containing error information for each field.
# File lib/deviantart/error.rb, line 13
# File lib/deviantart/error.rb, line 35 def to_s messages = [] messages << self.class.name messages << "status_code: #{@status_code}" messages << "error_code: #{@error_code}" if @error_code messages << "error: #{@error}" if @error messages << "error_description: #{@error_description}" if @error_description messages << "error_details: #{@error_details}" if @error_details messages.join(', ') end