class OAuth2ServerRestfulException in OAuth2 Server 7
Adapts exceptions from OAuth2 to RESTful formats.
Hierarchy
- class \RestfulException extends \Exception
- class \RestfulUnauthorizedException
- class \OAuth2ServerRestfulException
- class \RestfulUnauthorizedException
Expanded class hierarchy of OAuth2ServerRestfulException
File
- plugins/
authentication/ OAuth2ServerRestfulAuthentication.class.php, line 50 - Contains RestfulOAuth2Authentication and OAuth2ServerRestfulException.
View source
class OAuth2ServerRestfulException extends \RestfulUnauthorizedException {
protected $response;
public function __construct(\OAuth2\Response $response) {
$this->response = $response;
$this->code = $response
->getStatusCode();
$this->description = $response
->getStatusText();
$this->message = $response
->getResponseBody();
}
/**
* {@inheritdoc}
*/
public function getHeaders() {
return $this->response
->getHttpHeaders();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
OAuth2ServerRestfulException:: |
protected | property | ||
OAuth2ServerRestfulException:: |
public | function |
Get the associative array of headers. Overrides RestfulException:: |
|
OAuth2ServerRestfulException:: |
public | function | ||
RestfulException:: |
protected | property | Array keyed by the field name, and array of error messages as value. | |
RestfulException:: |
protected | property | Array of extra headers to set when throwing an exception. | |
RestfulException:: |
public | function | Add an error per field. | |
RestfulException:: |
final public | function | Gets the description of the exception. | |
RestfulException:: |
public | function | Return an array with all the errors. | |
RestfulException:: |
public | function | Get the URL to the error for the particular case. | |
RestfulException:: |
public | function | Return a string to the common problem type. | |
RestfulException:: |
public | function | Set a header. | |
RestfulUnauthorizedException:: |
protected | property | Defines the HTTP error code. | |
RestfulUnauthorizedException:: |
protected | property |
Defines the description. Overrides RestfulException:: |
|
RestfulUnauthorizedException:: |
protected | property |
Defines the instance resource. Overrides RestfulException:: |