Constructor
new Response(request, data)
Response constructor.
Response constructor.
Parameters:
Name | Type | Description |
---|---|---|
request |
Request | |
data |
Object |
- Source:
Returns:
void
Methods
getData() → {Array}
Get the underlying data object.
Get the underlying data object.
- Source:
Returns:
- Type
- Array
getErrorCode() → (nullable) {string}
Get the error code.
Get the error code.
- Source:
Returns:
- Type
- string
getErrorField() → (nullable) {string}
Get the field which triggered the error.
Get the field which triggered the error.
- Source:
Returns:
- Type
- string
getErrorFieldMessage() → (nullable) {string}
Get the error message associated with the error field that cause the error.
Get the error message associated with the error field that cause the error.
- Source:
Returns:
- Type
- string
getErrorFields() → {Array}
Get the fields which encountered a validation error.
Get the fields which encountered a validation error.
- Source:
Returns:
- Type
- Array
getErrorMessage() → (nullable) {string}
Get the error message.
Get the error message.
- Source:
Returns:
- Type
- string
getErrors() → {Array}
Get the error messages associated with the response.
Get the error messages associated with the response.
- Source:
Returns:
- Type
- Array
getInputErrorCount() → {number}
Get the number of input errors.
Get the number of input errors.
- Source:
Returns:
- Type
- number
getRequest() → {Request}
Get the initiating Request object.
Get the initiating Request object.
- Source:
Returns:
- Type
- Request
isError() → {boolean}
Check is the response was a error.
Check is the response was a error.
- Source:
Returns:
- Type
- boolean
isInputError() → {boolean}
Check if the error response is a input error.
Check if the error response is a input error.
- Source:
Returns:
- Type
- boolean
isListError() → {boolean}
Check if the error response is a list error.
Check if the error response is a list error.
- Source:
Returns:
- Type
- boolean
isSuccess() → {boolean}
Check is the response was a success.
Check is the response was a success.
- Source:
Returns:
- Type
- boolean
isValidationError() → {boolean}
Check if the error response is a validation error.
Check if the error response is a validation error.
- Source:
Returns:
- Type
- boolean