HttpError.php in Little helpers 7
Same filename and directory in other branches
Namespace
Drupal\little_helpers\RestFile
src/Rest/HttpError.phpView source
<?php
namespace Drupal\little_helpers\Rest;
/**
* An exception class that signifies a non 200 HTTP response.
*/
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;
}
}