Thanks Russ! I looked into converting all 404's errors to unhandled exceptions... but error.html.php, doesn't get decorated with the layout so I'll take a crack overriding the sf404Exception.
I'll post my patch when it's done. On Sun, Sep 13, 2009 at 1:12 PM, rooster (Russ) <russmon...@gmail.com>wrote: > > Sorry, my bad - on closer inspection this is not the case for 404 > exceptions. Not sure why, this would be a useful feature! > > The only place that gets the error message is the php error_log > function, which means in theory you could retrieve the error using > error_get_last(). This is not wise though, as there could be other > errors in the meantime! > > It would certainly be a useful feature for the message that is passed > to be stored in the parameter holder or elsewhere - maybe submit a > feature request for this. > > In the meantime, unless anyone else can think of something, the only > thing I can suggest is that you override the sf404Exception class to > store the message for you. > > On Sep 13, 3:04 pm, Patrick Cummins <patwcumm...@gmail.com> wrote: > > Russ, unfortunately the $exception variable doesn't seem to available > when I > > send a 404 (see code below). The $exception variable IS available when I > > throw an unhandled exception from an action. Unfortunately, my entire > app > > was built to throw errors (for missing parameters and just about > everything > > else) using the forward404 method. > > > > [code] > > public function executeSomething(sfWebRequest $request){ > > $this->forward404(" throwing an error the way that sample code in > > documentation is ")} > > > > [code] > > > > Any thoughts? > > > > Using latest symfony 1.2.8 > > > > On Sun, Sep 13, 2009 at 7:49 AM, rooster (Russ) <russmon...@gmail.com > >wrote: > > > > > > > > > On Sep 13, 9:05 am, pcummins <patwcumm...@gmail.com> wrote: > > > > How do I get the message from a call to $this->forward404() into a > > > > customized error404Success.php template? > > > > > Your custom template should have a variable called $exception, which > > > is the sfError404Exception object... The message is the exception > > > message ($exception->getMessage()) > > > > > Russ. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---