|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
skymouse Smarty Rookie
Joined: 05 May 2012 Posts: 7
|
Posted: Sat May 05, 2012 7:44 pm Post subject: 503 header wanted for smarty's error handler |
|
|
Hello,
My question is this: when Smarty's exception handling gets triggered and an error is displayed, would it be possible for the response to have a 503 HTTP status code (if no output has been made already by that time)?
Although screw-ups shouldn't happen in a live production application, sometimes the reality in the real world is that something goes wrong, or a "simple and safe" change to the application or a template messes up. It'd be useful if a screwed page can have a 503 header so the search engines know there's nothing here to see today.
On another note, and not directly related to my main question above, I noticed there was some debate going back a couple of years about the issue of Smarty's exception handling, whether there should be a mechanism to disable it, and if so how, etc. etc. I don't know if that debate was ever concluded to everyone's complete satisfaction. I would be interested to know if it has. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue May 08, 2012 8:34 pm Post subject: |
|
|
You can catch the Smarty exceptions by PHP try/catch and send the header in case of an exception. |
|
Back to top |
|
skymouse Smarty Rookie
Joined: 05 May 2012 Posts: 7
|
Posted: Tue May 08, 2012 11:15 pm Post subject: |
|
|
Many thanks - I will do it that way. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|