Files
lean/src/ApplicationStrategy/ThrowableHandler.php
T

22 lines
570 B
PHP

<?php
namespace Lean\ApplicationStrategy;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
class ThrowableHandler implements ThrowableHandlerInterface
{
public function process(
ServerRequestInterface $request,
RequestHandlerInterface $handler
): ResponseInterface {
try {
return $handler->handle($request);
} catch (Throwable $e) {
throw $e;
}
}
}