<?php

declare(strict_types=1);

namespace PhpWA\Exception;

class ConnectionClosedException extends TransportException
{
    /** @var int|null */ private $closeCode;
    /** @var string */ private $closeReason;

    public function __construct(string $message, ?int $closeCode = null, string $closeReason = '')
    {
        parent::__construct($message);
        $this->closeCode = $closeCode;
        $this->closeReason = $closeReason;
    }

    public function closeCode(): ?int { return $this->closeCode; }
    public function closeReason(): string { return $this->closeReason; }
}
