How to solve this error in php slim3

$c = new \Slim\Container();
$c['errorHandler'] = function ($c) {
    return function ($request, $response, $exception) use ($c) {
        return $response->withStatus(500)
            ->withHeader('Content-Type', 'text/html')
            ->write('Something went wrong!');
    };
};
$app = new \Slim\App($c);
$response = $response->withStatus(500)
    ->withHeader('Content-Type', 'text/html');

$response->getBody()->write('Something went wrong!');

return $response;
1 Like