fix(gitea) : propagate API errors instead of silently returning empty results

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 18:58:55 +01:00
parent 63e4af785e
commit 4c19b68156
5 changed files with 36 additions and 11 deletions

View File

@@ -11,6 +11,7 @@ use App\Entity\Task;
use App\Exception\GiteaApiException;
use App\Service\GiteaApiService;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
final readonly class GiteaPullRequestProvider implements ProviderInterface
{
@@ -35,8 +36,8 @@ final readonly class GiteaPullRequestProvider implements ProviderInterface
try {
$prs = $this->giteaApiService->listPullRequests($project, $taskCode);
} catch (GiteaApiException) {
return [];
} catch (GiteaApiException $e) {
throw new BadRequestHttpException($e->getMessage(), $e);
}
return array_map(static function (array $pr): GiteaPullRequest {