Skip to content

RedirectionHttpExceptionMiddleware


  • Full name: \Codefy\Framework\Http\Middleware\Exception\RedirectionHttpExceptionMiddleware
  • This class implements: MiddlewareInterface

Properties

app

protected \Codefy\Framework\Application $app

errorView

protected \Codefy\Framework\View\ErrorViewRenderer $errorView

Methods

__construct

public __construct(\Codefy\Framework\Application $app, \Codefy\Framework\View\ErrorViewRenderer $errorView): mixed

Parameters:

Parameter Type Description
$app \Codefy\Framework\Application
$errorView \Codefy\Framework\View\ErrorViewRenderer

process

public process(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Server\RequestHandlerInterface $handler): \Psr\Http\Message\ResponseInterface

Parameters:

Parameter Type Description
$request \Psr\Http\Message\ServerRequestInterface
$handler \Psr\Http\Server\RequestHandlerInterface

Throws:


Inherited methods

normalizeStatusCode

protected normalizeStatusCode(int $code): int

Parameters:

Parameter Type Description
$code int

isJson

protected isJson(\Psr\Http\Message\ServerRequestInterface $request): bool

Parameters:

Parameter Type Description
$request \Psr\Http\Message\ServerRequestInterface

getSafeReferrer

protected getSafeReferrer(\Psr\Http\Message\ServerRequestInterface $request): string

Parameters:

Parameter Type Description
$request \Psr\Http\Message\ServerRequestInterface

shouldRenderView

protected shouldRenderView(): bool

Throws:


logException

protected logException(\Throwable $t): void

Parameters:

Parameter Type Description
$t \Throwable

Throws:


renderErrorView

protected renderErrorView(\Throwable $t): \Psr\Http\Message\ResponseInterface

Parameters:

Parameter Type Description
$t \Throwable

Throws:


redirectWithHttpError

protected redirectWithHttpError(\Psr\Http\Message\ServerRequestInterface $request, \Qubus\Exception\Http\HttpException|\Qubus\Exception\Http\Psr7Exception $e): \Psr\Http\Message\ResponseInterface

Parameters:

Parameter Type Description
$request \Psr\Http\Message\ServerRequestInterface
$e \Qubus\Exception\Http\HttpException|\Qubus\Exception\Http\Psr7Exception

Throws:


jsonHttpErrorResponse

protected jsonHttpErrorResponse(\Qubus\Exception\Http\Psr7Exception $e): \Psr\Http\Message\ResponseInterface

Parameters:

Parameter Type Description
$e \Qubus\Exception\Http\Psr7Exception

Throws:


redirectWithInternalError

protected redirectWithInternalError(\Psr\Http\Message\ServerRequestInterface $request): \Psr\Http\Message\ResponseInterface

Parameters:

Parameter Type Description
$request \Psr\Http\Message\ServerRequestInterface

jsonInternalErrorResponse

protected jsonInternalErrorResponse(\Throwable $t): \Psr\Http\Message\ResponseInterface

Parameters:

Parameter Type Description
$t \Throwable

Throws:


handleHttpException

protected handleHttpException(\Qubus\Exception\Http\HttpException|\Qubus\Exception\Http\Psr7Exception $e, \Psr\Http\Message\ServerRequestInterface $request): \Psr\Http\Message\ResponseInterface

Parameters:

Parameter Type Description
$e \Qubus\Exception\Http\HttpException|\Qubus\Exception\Http\Psr7Exception
$request \Psr\Http\Message\ServerRequestInterface

Throws:


handleUnknownException

protected handleUnknownException(\Throwable $t, \Psr\Http\Message\ServerRequestInterface $request): \Psr\Http\Message\ResponseInterface

Parameters:

Parameter Type Description
$t \Throwable
$request \Psr\Http\Message\ServerRequestInterface

Throws: