adjust the return of response when error occured during activeUserBankAccount
This commit is contained in:
parent
beb26e269f
commit
f782796ef6
|
|
@ -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);
|
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);
|
return $this->errorResponse('Error_occurred', 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue