How do you find the route that caused the 404?

I’m getting a 404 on this route and I want to report it back to my server. On my 404 page init code, what do I call to get the name of the missing file and the route that was called which produced the 404?

If I understood correctly, it is necessary to send the wrong route to your server. For this you have to look at the route before coming to a 404 page.