<?php

namespace DMD\LaLigaApi\Exception;

use Symfony\Component\HttpFoundation\Response;
use Throwable;

class ValidationException extends \Exception
{
    public function __construct(
        private readonly array $validationErrors,
        string $message = "",
        int $code = Response::HTTP_BAD_REQUEST,
        ?Throwable $previous = null,
    )
    {
        parent::__construct($message, $code, $previous);
    }

    public function getValidationErrors(): array
    {
        return $this->validationErrors;
    }
}