Exception: KnoxCall::ValidationError

Inherits:
APIError show all
Defined in:
lib/knoxcall/errors.rb

Overview

422 — the request body failed server-side validation. When the server returns a per-field breakdown it is available via #fields.

Instance Attribute Summary

Attributes inherited from APIError

#body, #code, #headers, #request_id, #status_code

Instance Method Summary collapse

Methods inherited from APIError

#initialize, #type

Constructor Details

This class inherits a constructor from KnoxCall::APIError

Instance Method Details

#fields ⇒ Object

Per-field validation messages (=> [msg, ...]) when the server supplied them, else nil.



68
69
70
# File 'lib/knoxcall/errors.rb', line 68

def fields
  @body.is_a?(Hash) ? @body["fields"] : nil
end