ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\HTTP\ClientHttpException Class Reference

This exception represents a HTTP error coming from the Client. More...

+ Inheritance diagram for Sabre\HTTP\ClientHttpException:
+ Collaboration diagram for Sabre\HTTP\ClientHttpException:

Public Member Functions

 __construct (ResponseInterface $response)
 Constructor. More...
 
 getHttpStatus ()
 The http status code for the error. More...
 
 getResponse ()
 Returns the full response object. More...
 
 getHttpStatus ()
 The http status code for the error. More...
 

Protected Attributes

 $response
 

Detailed Description

This exception represents a HTTP error coming from the Client.

By default the Client will not emit these, this has to be explicitly enabled with the setThrowExceptions method.

Author
Evert Pot (http://evertpot.com/) @license http://sabre.io/license/ Modified BSD License

Definition at line 15 of file ClientHttpException.php.

Constructor & Destructor Documentation

◆ __construct()

Sabre\HTTP\ClientHttpException::__construct ( ResponseInterface  $response)

Constructor.

Parameters
ResponseInterface$response

Definition at line 29 of file ClientHttpException.php.

29 {
30
31 $this->response = $response;
32 parent::__construct($response->getStatusText(), $response->getStatus());
33
34 }

References Sabre\HTTP\ClientHttpException\$response.

Member Function Documentation

◆ getHttpStatus()

Sabre\HTTP\ClientHttpException::getHttpStatus ( )

The http status code for the error.

Returns
int

Implements Sabre\HTTP\HttpException.

Definition at line 41 of file ClientHttpException.php.

41 {
42
43 return $this->response->getStatus();
44
45 }

Referenced by Sabre\HTTP\ClientTest\testHttpErrorException().

+ Here is the caller graph for this function:

◆ getResponse()

Sabre\HTTP\ClientHttpException::getResponse ( )

Returns the full response object.

Returns
ResponseInterface

Definition at line 52 of file ClientHttpException.php.

52 {
53
54 return $this->response;
55
56 }

References Sabre\HTTP\ClientHttpException\$response.

Referenced by Sabre\HTTP\ClientTest\testHttpErrorException().

+ Here is the caller graph for this function:

Field Documentation

◆ $response

Sabre\HTTP\ClientHttpException::$response
protected

The documentation for this class was generated from the following file: