Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07a47d6a5c | ||
|
|
59e6e11929 |
5 changed files with 9 additions and 3 deletions
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
### All notable changes to `CRM CLient V4` will be documented in this file.
|
### All notable changes to `CRM CLient V4` will be documented in this file.
|
||||||
|
|
||||||
|
# version 4.1.9
|
||||||
|
|
||||||
|
- fix: 🐛 set new ApiError unknown value due to fallback response error #2
|
||||||
|
|
||||||
# version 4.1.8
|
# version 4.1.8
|
||||||
|
|
||||||
- fix: 🐛 remove sending brand id in claim call #52
|
- fix: 🐛 remove sending brand id in claim call #52
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "4.1.8",
|
"version": "4.1.9",
|
||||||
"timestampTimeout": 30,
|
"timestampTimeout": 30,
|
||||||
"apiRequestRatePerMinute": 256,
|
"apiRequestRatePerMinute": 256,
|
||||||
"servicesDBCache": 10
|
"servicesDBCache": 10
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ldc/ldccrmv4client",
|
"name": "ldc/ldccrmv4client",
|
||||||
"version": "4.1.8",
|
"version": "4.1.9",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"description": "LDC CRM Client V4",
|
"description": "LDC CRM Client V4",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ enum ApiError: int
|
||||||
{
|
{
|
||||||
use BaseEnum;
|
use BaseEnum;
|
||||||
|
|
||||||
|
case unknown = 0;
|
||||||
case modelNotFound = 101;
|
case modelNotFound = 101;
|
||||||
case validationFailed = 102;
|
case validationFailed = 102;
|
||||||
case customerExists = 103;
|
case customerExists = 103;
|
||||||
|
|
@ -26,6 +27,7 @@ enum ApiError: int
|
||||||
* Optionnal labels definition
|
* Optionnal labels definition
|
||||||
*/
|
*/
|
||||||
private const LABELS = [
|
private const LABELS = [
|
||||||
|
self::unknown->name => 'Erreur inconnue (%s).',
|
||||||
self::modelNotFound->name => '%s introuvable.',
|
self::modelNotFound->name => '%s introuvable.',
|
||||||
self::validationFailed->name => 'Impossible de valider les données',
|
self::validationFailed->name => 'Impossible de valider les données',
|
||||||
self::customerExists->name => 'L\'utilisateur est déjà enregistré sur ce site',
|
self::customerExists->name => 'L\'utilisateur est déjà enregistré sur ce site',
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ class Response
|
||||||
if ($this->status->equals(ApiStatus::KO)) {
|
if ($this->status->equals(ApiStatus::KO)) {
|
||||||
// * If CRM Exception or Any Exception.
|
// * If CRM Exception or Any Exception.
|
||||||
if ($this->httpCode === 500) {
|
if ($this->httpCode === 500) {
|
||||||
$this->apiError = $this->content['data']['code'];
|
$this->apiError = ApiError::make($this->content['data']['code']) ?? ApiError::unknown;
|
||||||
} else {
|
} else {
|
||||||
// * From here it should be an ApiErrorException.
|
// * From here it should be an ApiErrorException.
|
||||||
$this->apiError = ApiError::make($this->content['data']['code']);
|
$this->apiError = ApiError::make($this->content['data']['code']);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue