<?php

/**
 * LolaCore - SkillValidationError
 *
 * Thrown by SkillValidator when the parsed frontmatter fails a stage-2
 * semantic validation (missing required field, invalid semver, invalid
 * regex, etc.).
 *
 * @package LolaCore
 * @license GPL-2.0-or-later
 */

declare(strict_types=1);

namespace LolaCore\Skills\Exceptions;

class SkillValidationError 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;
    }
}
