<?php

declare(strict_types=1);

namespace PostService\Node;

final class ApiException extends \RuntimeException
{
    private string $errorCode;
    private int $httpStatus;

    public function __construct(
        string $message,
        string $errorCode,
        int $httpStatus = 400
    ) {
        parent::__construct($message);
        $this->errorCode = $errorCode;
        $this->httpStatus = $httpStatus;
    }

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

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