class HttpError in Little helpers 7
Same name and namespace in other branches
- 7.2 src/Rest/HttpError.php \Drupal\little_helpers\Rest\HttpError
An exception class that signifies a non 200 HTTP response.
Hierarchy
- class \Drupal\little_helpers\Rest\HttpError extends \Drupal\little_helpers\Rest\Exception
Expanded class hierarchy of HttpError
File
- src/
Rest/ HttpError.php, line 8
Namespace
Drupal\little_helpers\RestView source
class HttpError extends \Exception {
public $result;
/**
* Construct the error class from a result object.
*/
public function __construct($result) {
$msg = "HTTP {$result->code}: {$result->error}";
parent::__construct($msg, $result->code);
$this->result = $result;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HttpError:: |
public | property | ||
HttpError:: |
public | function | Construct the error class from a result object. |