1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 00:02:41 +01:00
phorge-phorge/externals/twilio-php/Services/Twilio/RestException.php
Bob Trahan e96c363eef Add SMS support
Summary:
Provides a working SMS implementation with support for Twilio.

This version doesn't really retry if we get any gruff at all. Future versions should retry.

Test Plan: used bin/sms to send messages and look at them.

Reviewers: chad, epriestley

Reviewed By: epriestley

Subscribers: aurelijus, epriestley, Korvin

Maniphest Tasks: T920

Differential Revision: https://secure.phabricator.com/D8930
2014-05-09 12:47:21 -07:00

44 lines
1.1 KiB
PHP
Executable file

<?php
/**
* An exception talking to the Twilio API. This is thrown whenever the Twilio
* API returns a 400 or 500-level exception.
*
* :param int $status: the HTTP status for the exception
* :param string $message: a human-readable error message for the exception
* :param int $code: a Twilio-specific error code for the exception
* :param string $info: a link to more information
*/
class Services_Twilio_RestException extends Exception {
/**
* The HTTP status for the exception.
*/
protected $status;
/**
* A URL to get more information about the error. This is not always
* available
*/
protected $info;
public function __construct($status, $message, $code = 0, $info = '') {
$this->status = $status;
$this->info = $info;
parent::__construct($message, $code);
}
/**
* Get the HTTP status code
*/
public function getStatus() {
return $this->status;
}
/**
* Get a link to more information
*/
public function getInfo() {
return $this->info;
}
}