Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Alexis Gousseau
07a47d6a5c
chore: 🔖 release v4.1.9 2026-07-29 10:49:44 +02:00
Alexis Gousseau
59e6e11929
fix: 🐛 set new ApiError unknown value due to fallback response error #2 2026-07-29 10:49:00 +02:00
5 changed files with 9 additions and 3 deletions

View file

@ -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

View file

@ -1,5 +1,5 @@
{ {
"version": "4.1.8", "version": "4.1.9",
"timestampTimeout": 30, "timestampTimeout": 30,
"apiRequestRatePerMinute": 256, "apiRequestRatePerMinute": 256,
"servicesDBCache": 10 "servicesDBCache": 10

View file

@ -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",

View file

@ -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',

View file

@ -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']);