Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
503 header wanted for smarty's error handler

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
skymouse
Smarty n00b


Joined: 05 May 2012
Posts: 2

PostPosted: Sat May 05, 2012 7:44 pm    Post subject: 503 header wanted for smarty's error handler Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4587
Location: Hamburg / Germany

PostPosted: Tue May 08, 2012 8:34 pm    Post subject: Reply with quote

You can catch the Smarty exceptions by PHP try/catch and send the header in case of an exception.
Back to top
View user's profile Send private message
skymouse
Smarty n00b


Joined: 05 May 2012
Posts: 2

PostPosted: Tue May 08, 2012 11:15 pm    Post subject: Reply with quote

Many thanks - I will do it that way.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP