Class ErrorResponseException
Exception for responses with status code 400
- Exception implements Throwable
- Commercetools\Core\Error\ApiException
- Commercetools\Core\Error\ApiServiceException
- Commercetools\Core\Error\ClientErrorException
- Commercetools\Core\Error\BadRequestException
- Commercetools\Core\Error\ErrorResponseException
Namespace: Commercetools\Core\Error
Description:
Located at Core/Error/ErrorResponseException.php
Description:
ErrorCodes
InvalidField
One possible cause could be, that you try to set the value of a product attribute and the type is not matching or you have an enum field and the key is wrong.
Example:
{
"statusCode": 400,
"message": "The value '2' is not valid for field 'fieldNameExample'. Allowed values are: \"red\",\"green\".",
"errors": [{
"code": "InvalidField",
"message": "The value '2' is not valid for field 'fieldNameExample'. Allowed values are: \"red\",\"green\".",
"invalidValue": 2,
"allowedValues": ["red","green"],
"field": "fieldNameExample"
}]
}
Located at Core/Error/ErrorResponseException.php
Methods summary
Methods inherited from Commercetools\Core\Error\ClientErrorException
Methods inherited from Commercetools\Core\Error\ApiException
__construct()
,
create()
,
getErrors()
,
getRequest()
,
getResponse()
,
getResponseMessage()
,
getResponseStatusCode()
Methods inherited from Exception
__toString()
,
__wakeup()
,
getCode()
,
getFile()
,
getLine()
,
getMessage()
,
getPrevious()
,
getTrace()
,
getTraceAsString()