<?php

/**
 * LolaCore - PlaybookValidationError
 *
 * Thrown by PlaybookValidator when frontmatter or body fails semantic
 * validation (missing required field, invalid semver, body too large, etc.).
 *
 * @package LolaCore
 * @license GPL-2.0-or-later
 */

declare(strict_types=1);

namespace LolaCore\Playbooks\Exceptions;

class PlaybookValidationError extends \RuntimeException
{
    private string $field;
    private string $filePath;

    public function __construct(string $message, string $field, string $filePath = '')
    {
        parent::__construct($message);
        $this->field    = $field;
        $this->filePath = $filePath;
    }

    public function getField(): string
    {
        return $this->field;
    }

    public function getFilePath(): string
    {
        return $this->filePath;
    }
}
