You are here

class HttpError in Little helpers 7

Same name and namespace in other branches
  1. 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\Rest
View 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

Namesort descending Modifiers Type Description Overrides
HttpError::$result public property
HttpError::__construct public function Construct the error class from a result object.