How to throw not found exception PSR7 [SOLVED]


#1

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?

Thanks.


#2

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


#3

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

i will create factory class for other frameworks.

Thanks