mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-26 05:23:30 +05:30
unify middleware exception responses
This commit is contained in:
parent
c0936cc320
commit
22e6a350dd
@ -46,9 +46,8 @@ class AuthorizationServerMiddleware
|
|||||||
return $exception->generateHttpResponse($response);
|
return $exception->generateHttpResponse($response);
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
$response->getBody()->write($exception->getMessage());
|
return (new OAuthServerException($exception->getMessage(), 0, 'unknown_error', 500))
|
||||||
|
->generateHttpResponse($response);
|
||||||
return $response->withStatus(500);
|
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,9 +46,8 @@ class ResourceServerMiddleware
|
|||||||
return $exception->generateHttpResponse($response);
|
return $exception->generateHttpResponse($response);
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
$response->getBody()->write($exception->getMessage());
|
return (new OAuthServerException($exception->getMessage(), 0, 'unknown_error', 500))
|
||||||
|
->generateHttpResponse($response);
|
||||||
return $response->withStatus(500);
|
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user