RestException.php 816 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Twilio\Exceptions;
  3. class RestException extends TwilioException {
  4. protected $statusCode;
  5. /**
  6. * Construct the exception. Note: The message is NOT binary safe.
  7. * @link http://php.net/manual/en/exception.construct.php
  8. * @param string $message [optional] The Exception message to throw.
  9. * @param int $code [optional] The Exception code.
  10. * @param int $statusCode [optional] The HTTP Status code.
  11. * @since 5.1.0
  12. */
  13. public function __construct($message, $code, $statusCode) {
  14. $this->statusCode = $statusCode;
  15. parent::__construct($message, $code);
  16. }
  17. /**
  18. * Get the HTTP Status Code of the RestException
  19. * @return int HTTP Status Code
  20. */
  21. public function getStatusCode() {
  22. return $this->statusCode;
  23. }
  24. }