<?php

namespace classes;

class limited_backoffice_exception extends \RuntimeException
{
    public function __construct(
        string $message,
        private readonly int $statusCode = 400,
        private readonly ?array $payload = null
    ) {
        parent::__construct($message);
    }

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

    public function payload(): array|string
    {
        return $this->payload ?? $this->getMessage();
    }
}
