mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-22 21:19:46 +05:30
Added generateHttpResponse method to exception
This commit is contained in:
parent
26c1abdd3c
commit
72b741d7c9
@ -127,4 +127,22 @@ class OAuthException extends \Exception
|
||||
// @codeCoverageIgnoreEnd
|
||||
return $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a HTTP response
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function generateHttpResponse()
|
||||
{
|
||||
return new Response(
|
||||
json_encode(
|
||||
[
|
||||
'error' => $this->errorType,
|
||||
'message' => $this->getMessage()
|
||||
]
|
||||
),
|
||||
$this->httpStatusCode,
|
||||
$this->getHttpHeaders()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user