<?php

namespace PortalPeople\virtualstock\exceptions;

class ValidationException extends ApiException
{
    /** @var array<string, string[]> */
    private array $errors;

    /**
     * @param array<string, string[]> $errors
     */
    public function __construct(
        string $message = 'VirtualStock API validation failed',
        array $errors = [],
        string $responseBody = '',
        ?\Throwable $previous = null
    ) {
        $this->errors = $errors;
        parent::__construct($message, 500, $responseBody, $previous);
    }

    /**
     * @return array<string, string[]>
     */
    public function getErrors(): array
    {
        return $this->errors;
    }
}
