summaryrefslogtreecommitdiffstats
path: root/Twilio/Exceptions/RestException.php
blob: 00c9da3b69b690c2e2377f4154ff6b9941b8999b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php


namespace Twilio\Exceptions;


class RestException extends TwilioException {
    protected $statusCode;

    /**
     * Construct the exception. Note: The message is NOT binary safe.
     * @link http://php.net/manual/en/exception.construct.php
     * @param string $message [optional] The Exception message to throw.
     * @param int $code [optional] The Exception code.
     * @param int $statusCode [optional] The HTTP Status code.
     * @since 5.1.0
     */
    public function __construct($message, $code, $statusCode) {
        $this->statusCode = $statusCode;
        parent::__construct($message, $code);
    }

    /**
     * Get the HTTP Status Code of the RestException
     * @return int HTTP Status Code
     */
    public function getStatusCode() {
        return $this->statusCode;
    }


}