I am wanting to throw a “HttpNotFoundException” inside of a service/dependancy that I have however the exception requires the request variable which is the type: “ServerRequestInterface”. My services don’t know about the request variable so this is not possible.
I am mainly using the slim framework template. I am using an Endpoint -> Service model so that functions inside of the services can be used in multiple different endpoints.
I know that I could just make my own exceptions but I wanted to first check if there was a way to either access the request variable from somewhere else OR there was another exception that already exists.