<?php

namespace PortalPeople\virtualstock\exceptions;

class ApiException extends \RuntimeException
{
    private int $statusCode;
    private string $responseBody;

    public function __construct(string $message, int $statusCode = 0, string $responseBody = '', ?\Throwable $previous = null)
    {
        $this->statusCode = $statusCode;
        $this->responseBody = $responseBody;

        parent::__construct($message, $statusCode, $previous);
    }

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

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