Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Smarty (still) ignores own error handler for muting errors

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


Joined: 14 Jun 2009
Posts: 4

PostPosted: Fri Feb 24, 2012 12:49 pm    Post subject: Smarty (still) ignores own error handler for muting errors Reply with quote

Hello,

So, today I've started on a new project, downloaded the new Smarty and got to work. I use set_error_handler to track and display the errors nicely, so it doesn't bother users.

I tried to display a template, but I got a filemtime() error. Smarty expects there errors and they are normally expected (and muted) by Smarty, but apparently, if you are using a set_error_handler() yourself, Smarty is not able to mute them any more (after I commented out my own error handler, Smarty managed to mute them again).

Is this something that is wrong in my own configuration or is this a Smarty-side bug?

Regards,

Wesley
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 698
Location: Germany, border to Switzerland

PostPosted: Fri Feb 24, 2012 1:14 pm    Post subject: Reply with quote

Have a look at Smarty::muteExpectedErrors() and the code-comments explaining why this is necessary.
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
mentar
Smarty n00b


Joined: 02 Mar 2012
Posts: 1

PostPosted: Fri Mar 02, 2012 2:27 am    Post subject: Reply with quote

Thanks for this post!!!!!
I've just hit the same problem and have been battling it for the past few hours and was close to pulling my hair out.
Surely it's a common problem though? Maybe it's worth mentioning in the Quick Install page of the site?
Many thanks!!
Back to top
View user's profile Send private message
ToySoldier
Smarty n00b


Joined: 14 Jun 2009
Posts: 4

PostPosted: Wed Mar 28, 2012 12:54 pm    Post subject: Reply with quote

Hi rodneyrehm,

Thanks for your reply.

I have looked at the function and it's code, however, it's not something I have been able to fix. I understand why the errors are being muted, but at this moment, Smarty is colliding with my own code and error handlers, which is of course not wanted!

I wondered if it was may be something the developers could fix, because I very much would like to use my own error handlers to suppress errors Smile

Regards,

Wesley
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 698
Location: Germany, border to Switzerland

PostPosted: Tue Apr 17, 2012 2:42 pm    Post subject: Reply with quote

Here's a bit more background on what's happening and why we did it: http://blog.rodneyrehm.de/archives/12-Improving-Disk-IO-in-PHP-Apps.html
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
ToySoldier
Smarty n00b


Joined: 14 Jun 2009
Posts: 4

PostPosted: Wed May 16, 2012 12:49 pm    Post subject: Reply with quote

Is there a way to detect which of these errors are caused by Smarty so we are still able to use our own error reporters? I understand why the decisions in code were made, it would still be nice if we can track the errors with our own codes Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development 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