1<?php
2
3namespace MaxMind\Exception;
4
5/**
6 *  This class represents an HTTP transport error.
7 */
8class HttpException extends WebServiceException
9{
10    /**
11     * The URI queried.
12     */
13    private $uri;
14
15    /**
16     * @param string     $message    a message describing the error
17     * @param int        $httpStatus the HTTP status code of the response
18     * @param string     $uri        the URI used in the request
19     * @param \Exception $previous   the previous exception, if any
20     */
21    public function __construct(
22        $message,
23        $httpStatus,
24        $uri,
25        \Exception $previous = null
26    ) {
27        $this->uri = $uri;
28        parent::__construct($message, $httpStatus, $previous);
29    }
30
31    public function getUri()
32    {
33        return $this->uri;
34    }
35
36    public function getStatusCode()
37    {
38        return $this->getCode();
39    }
40}
41