modification gestion des exceptions
Some checks failed
Cadoles/hydra-sql/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
2024-10-11 15:06:32 +02:00
parent cb8361e7d1
commit 999e708ff7
10 changed files with 37 additions and 121 deletions

View File

@ -2,9 +2,7 @@
namespace App\Service;
use App\SQLLogin\Exception\DataToFetchConfigurationException;
use App\SQLLogin\Exception\EmptyResultException;
use App\SQLLogin\Exception\NullDataToFetchException;
use App\SQLLogin\SQLLoginConnect;
use App\SQLLogin\SQLLoginRequest;
use PDO;
@ -25,12 +23,8 @@ class SQLLoginService extends AbstractController
public function fetchPasswordAndDatas(string $login): array
{
try {
$dataRequest = $this->sqlLoginRequest->getDatasRequest();
$datas = $this->executeRequestWithLogin($dataRequest, $login);
} catch (NullDataToFetchException $e) {
throw new DataToFetchConfigurationException($e->getMessage());
}
$dataRequest = $this->sqlLoginRequest->getDatasRequest();
$datas = $this->executeRequestWithLogin($dataRequest, $login);
return $datas;
}