mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-01 01:40:21 +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
|
// @codeCoverageIgnoreEnd
|
||||||
return $headers;
|
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