public function HttpError::__construct in Little helpers 7.2
Same name and namespace in other branches
- 7 src/Rest/HttpError.php \Drupal\little_helpers\Rest\HttpError::__construct()
Construct the error class from a result object.
File
- src/
Rest/ HttpError.php, line 15
Class
- HttpError
- An exception class that signifies a non 200 HTTP response.
Namespace
Drupal\little_helpers\RestCode
public function __construct($result) {
$msg = "HTTP {$result->code}: {$result->error}";
parent::__construct($msg, $result->code);
$this->result = $result;
}