adjust the return of response when error occured during activeUserBankAccount

This commit is contained in:
root 2026-03-04 15:28:03 +01:00
parent beb26e269f
commit f782796ef6
1 changed files with 5 additions and 0 deletions

View File

@ -963,6 +963,11 @@ INNER JOIN countries c ON oc.id_country = c.id INNER JOIN type_operators top ON
]);
Log::error('Erreur Activation API pour ID ' . $bank_account->id . ' : ' . $errorBody);
if ($e->hasResponse()) {
$decodedBody = json_decode($errorBody, true);
$extractedMessage = $decodedBody['message'] ?? $errorBody;
return $this->errorResponse($extractedMessage, 500);
}
return $this->errorResponse('Error_occurred', 500);
}
}