4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Error handling
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Hertzsprung
WebHelper
WebHelper


Joined: 30 Jul 2002
Posts: 56
Location: UK

PostPosted: Thu Jan 30, 2003 4:01 pm (14 years, 8 months ago) Reply with QuoteBack to Top

I am using PHP4.1.2. (I realise this is now quite an old version, but I still use this because many web providers still run 4.1.x and 4.2.x.)

I have got my own error handler and have used error_reporting() to catch only E_PARSE and E_ERROR types. All other types are caught by my error handler. My problem comes when is use the @ error suppression operator on functions such as copy() and fopen(). I want these to fail without an error occuring, so that I may deal with them inline, and not in my error handler. However, the @ appears not to work, and an error is raised and caught by my error handler.

How can I stop this from happening? Is the only way to temporarily switch back to PHP's default error handler ( using error_reporting() ) when I want to use copy() or fopen() ?

Thanks in advance,
Hertzsprung
OfflineView User's ProfileFind all posts by HertzsprungSend Personal MessageVisit Poster's Website
Hertzsprung
WebHelper
WebHelper


Joined: 30 Jul 2002
Posts: 56
Location: UK

PostPosted: Tue Feb 04, 2003 9:50 am (14 years, 8 months ago) Reply with QuoteBack to Top

I've found the answer to my problem (thanks for the help, guys!). In the PHP docs, it says that a custom error handler will always be called if one is installed, even if the @ operator is used. However, in the case when @ was used, error_reporting() returns 0. So, in my error handler, I check if @ was used and just return if it was.
OfflineView User's ProfileFind all posts by HertzsprungSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 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.


Page generation time: 0.048229 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme