public function handle(ServerRequestInterface $request): ResponseInterface
    {
        $msg = "This is the default request handler. This means no middleware produced a response before hitting it.";

        $contents = json_encode([
            'type' => MiddlewareStackExhaustedException::class,
            'message' => $msg,
        ]);

        $response = $this->factory
            ->createResponse(404)
            ->withHeader('Content-type', 'application/json');

        $response->getBody()->write($contents);

        return $response;
    }
public function handle(ServerRequestInterface $request): ResponseInterface
    {
        $msg = "This is the default request handler. This means no middleware produced a response before hitting it.";

        $contents = json_encode([
            'type' => MiddlewareStackExhaustedException::class,
            'message' => $msg,
        ]);

        $response = $this->factory
            ->createResponse(404)
            ->withHeader('Content-type', 'application/json');

        $response->getBody()->write($contents);

        return $response;
    }
public function handle ( ServerRequestInterface $ request ) : ResponseInterface { $ msg = "This is the default request handler. This means no middleware produced a response before hitting it." ; $ contents = json_encode ( [ 'type' => MiddlewareStackExhaustedException :: class , 'message' => $ msg , ] ) ; $ response = $ this -> factory -> createResponse ( 404 ) -> withHeader ( 'Content-type' , 'application/json' ) ; $ response -> getBody ( ) -> write ( $ contents ) ; return $ response ; }
Return a notice json response.

@param \Psr\Http\Message\ServerRequestInterface $request
@return \Psr\Http\Message\ResponseInterface
Return a notice json response .