How to throw not found exception PSR7 [SOLVED]

I already know to throw not found in Slim is

throw new \Slim\Exception\NotFoundException($request, $response);

But i want to create a reusable middleware class use PSR7 which is applicable to use in other framework.

I dont know how to achieve this?


The reusability in other frameworks would require a standard (PSR-x) interface. But for this particular case there is no standard yet.

oh i see, so i must create my own request response handler http-message.

i will create factory class for other frameworks.