Class: Simplify::BadRequestException::FieldError
- Inherits:
-
Object
- Object
- Simplify::BadRequestException::FieldError
- Defined in:
- lib/simplify/apiexception.rb
Overview
A single error on a field of an API request.
Instance Attribute Summary collapse
-
#errorCode ⇒ Object
readonly
The code for the field error.
-
#fieldName ⇒ Object
readonly
The name of the field with the error.
-
#message ⇒ Object
readonly
Description of the error.
Instance Method Summary collapse
-
#initialize(errorData) ⇒ FieldError
constructor
A new instance of FieldError.
-
#to_s ⇒ Object
Returns string representation of the error.
Constructor Details
#initialize(errorData) ⇒ FieldError
Returns a new instance of FieldError.
99 100 101 102 103 |
# File 'lib/simplify/apiexception.rb', line 99 def initialize(errorData) @fieldName = errorData['field'] @errorCode = errorData['code'] @message = errorData['message'] end |
Instance Attribute Details
#errorCode ⇒ Object (readonly)
The code for the field error.
94 95 96 |
# File 'lib/simplify/apiexception.rb', line 94 def errorCode @errorCode end |
#fieldName ⇒ Object (readonly)
The name of the field with the error.
91 92 93 |
# File 'lib/simplify/apiexception.rb', line 91 def fieldName @fieldName end |
#message ⇒ Object (readonly)
Description of the error.
97 98 99 |
# File 'lib/simplify/apiexception.rb', line 97 def @message end |
Instance Method Details
#to_s ⇒ Object
Returns string representation of the error.
106 107 108 |
# File 'lib/simplify/apiexception.rb', line 106 def to_s() return "Field error: #{@fieldName} \"#{@message}\" (#{@errorCode})" end |