From 59cd0b178165ea7461d9fe8689f55f25186dd0e2 Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Thu, 3 Dec 2020 08:08:08 +0100 Subject: [PATCH] - Add client api call error format --- clients/LDCCRM_V1.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clients/LDCCRM_V1.php b/clients/LDCCRM_V1.php index 3007ef4..e450ad8 100644 --- a/clients/LDCCRM_V1.php +++ b/clients/LDCCRM_V1.php @@ -107,7 +107,8 @@ class ApiV1 )); $result = curl_exec($curl); - if(!$result){die("Connection Failure");} + if(!$result) + return ['status' => 'KO', 'code' => 500, 'message' => 'Connection to API failed']; curl_close($curl); return json_decode($result); }