class Simplify::BadRequestException
Exception representing invalid requests made to the API.
Attributes
fieldErrors[R]
List of field errors associatied with this error (empty if there are no field errors).
Public Class Methods
new(message, status, errorData)
click to toggle source
Calls superclass method
Simplify::ApiException::new
# File lib/simplify/apiexception.rb, line 116 def initialize(message, status, errorData) super(message, status, errorData) @fieldErrors = [] if errorData.has_key?('error') error = errorData['error'] if error.has_key?('fieldErrors') fieldErrors = error['fieldErrors'] fieldErrors.each do |fieldError| @fieldErrors << FieldError.new(fieldError) end end end end
Public Instance Methods
describe()
click to toggle source
Returns a string description of the error including any field errors.
# File lib/simplify/apiexception.rb, line 138 def describe() s = super_describe() @fieldErrors.each do |fieldError| s = s + "\n" + fieldError.to_s end return s + "\n" end
Also aliased as: super_describe
hasFieldErrors?()
click to toggle source
Returns boolean indicating if there are field errors associated with this API error.
# File lib/simplify/apiexception.rb, line 133 def hasFieldErrors? return @fieldErrors.length > 1 end