<?php

/**
 * Signals a filesystem failure while writing an artifact tree.
 *
 * @package LolaCore\Builder\Packaging
 * @license GPL-2.0-or-later
 */

declare(strict_types=1);

namespace LolaCore\Builder\Packaging;

if (! defined('ABSPATH')) {
	exit;
}

/**
 * Carries the relative path that failed so consumers can map the failure to
 * their own user-facing message ('' means the artifact directory itself).
 */
final class TreeWriteException extends \RuntimeException {

	public function __construct( private string $relPath, string $message ) {
		parent::__construct($message);
	}

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