class fb_GraphException in Drupal for Facebook 7.4
Define a custom exception class to keep track of both the HTTP response code and the facebook error code.
Hierarchy
- class \fb_GraphException extends \Exception
Expanded class hierarchy of fb_GraphException
File
- ./
fb.module, line 1840
View source
class fb_GraphException extends Exception {
public $graph_path;
public $http_code;
public $fb_code;
// Redefine the exception so message isn't optional
public function __construct($message, $fb_code, $http_code, Exception $previous = null) {
$this->http_code = $http_code;
// http response code
$this->fb_code = $fb_code;
// original error code from facebook.
// make sure everything is assigned properly
parent::__construct($message, $fb_code, $previous);
}
// custom string representation of object
public function __toString() {
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
}
public function customFunction() {
echo "A custom function for this type of exception\n";
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
fb_GraphException:: |
public | property | ||
fb_GraphException:: |
public | property | ||
fb_GraphException:: |
public | property | ||
fb_GraphException:: |
public | function | ||
fb_GraphException:: |
public | function | ||
fb_GraphException:: |
public | function |