Skip to content

ExceptionHandler


  • Full name: \Codefy\Framework\Http\Middleware\Exception\ExceptionHandler

Properties

strategies

protected array $strategies

app

protected \Codefy\Framework\Application $app

Methods

__construct

public __construct(class-string<\Codefy\Framework\Http\Middleware\Exception\Strategy\HttpResponseStrategy>[]|\Codefy\Framework\Http\Middleware\Exception\Strategy\HttpResponseStrategy[] $strategies, \Codefy\Framework\Application $app): mixed

Parameters:

Parameter Type Description
$strategies class-string<\Codefy\Framework\Http\Middleware\Exception\Strategy\HttpResponseStrategy>[]|\Codefy\Framework\Http\Middleware\Exception\Strategy\HttpResponseStrategy[]
$app \Codefy\Framework\Application

handle

public handle(\Throwable $e, \Psr\Http\Message\ServerRequestInterface $request): \Psr\Http\Message\ResponseInterface

Parameters:

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

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: