<?php

declare(strict_types=1);

namespace PpPhp\Core\Licensing;

/**
 * A licensing refusal whose message is safe to show an end user.
 *
 * Everything thrown as a LicenseException is written for the person staring at
 * the screen ("all seats are in use", "this licence expired on…"), never for a
 * log file — and it carries the HTTP status the API should answer with.
 */
final class LicenseException extends \RuntimeException
{
    public function __construct(string $message, private int $status = 400)
    {
        parent::__construct($message);
    }

    public function status(): int
    {
        return $this->status;
    }
}
