protected function getDisplayer(
        ?ServerRequestInterface $request,
        Throwable $original,
        Throwable $transformed,
        int $code
    ): DisplayerContract {
        $sortedDisplayers = [];

        \ksort($this->displayers);

        \array_walk_recursive($this->displayers, static function ($displayers, $key) use (&$sortedDisplayers): void {
            $sortedDisplayers[$key] = $displayers;
        });

        if ($request !== null) {
            $filtered = $this->getFiltered($sortedDisplayers, $request, $original, $transformed, $code);

            if (\count($filtered) !== 0) {
                return $this->sortedFilter($filtered, $request);
            }
        }

        return $sortedDisplayers[$this->resolvedOptions['http']['displayer']['default']];
    }