On 15.06.2011, at 17:43, Oleg Stepura wrote: > How that happens? If I call $this->get('request'); inside controller I can > access the request object. But if do the same in error handler on error that > occurred the same time (as I could ask for request in the controller) I > cannot get it. Seems strange for me.
i think you dont understand the concept of scopes yet, specifically the request scope. its purpose is to handle the fact that every subrequest is actually an entire new request. meaning that any service that relies on the request needs to be recreated within every subrequest, since if the service would be reused it would point to an outdated request. the purpose of scopes is to handle exactly that. aka ensuring that within each subrequest previously request dependent services are not carried over. as a result by default there is a "synthetic" request service which is just there to give users a better error message if they ask for the request service outside of a request scope. before entering a request scope, the kernel must be supplied with a request instance. once the subrequest is complete the scope is exited. now it seems like your handler is being triggered in the state outside of a request scope and therefore no request service is available. regards, Lukas Kahwe Smith m...@pooteeweet.org -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to symfony-devs@googlegroups.com To unsubscribe from this group, send email to symfony-devs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en