New to Slim: Creating custom error page

Hi Odan,

Thank you very much for your reply. I figured this out myself before I read your post, the main issue I was having was in the renderer:

final class HtmlErrorRenderer extends ErrorRendererInterface

should be:

final class HtmlErrorRenderer

This is what I ended up with in the DI, this works:

 // at the top of the script
  use App\Error\Renderer\HtmlErrorRenderer;


    ErrorMiddleware::class => function (ContainerInterface $container) {
    $app = $container->get(App::class);
    $settings = $container->get('settings')['error'];

    $errorMiddleware = new ErrorMiddleware(
        $app->getCallableResolver(),
        $app->getResponseFactory(),
        (bool)$settings['display_error_details'],
        (bool)$settings['log_errors'],
        (bool)$settings['log_error_details']
    );

    $errorHandler = $errorMiddleware->getDefaultErrorHandler();
    $errorHandler->registerErrorRenderer('text/html', HtmlErrorRenderer::class);

    return $errorMiddleware;

},