pkrtech Posted August 25, 2006 Share Posted August 25, 2006 if the XML file it is trying to call is not their it throws up errors how do I supress them so it continues the script and reports the error to me through mail().$xdom = new domDocument;$xdom->load($cycle); Quote Link to comment Share on other sites More sharing options...
448191 Posted August 25, 2006 Share Posted August 25, 2006 Well, normally you would use an custom errorhandler. But since you're into OOP you could also use exceptions. I've been meaning to get further into that myself.You can use the '@' to supress an error, then use the returnvalue to check if your want to throw your custom exception.[code]<?phpif(!@$xdom->load($cycle)){ throw new MyCustomException('message');}?>[/code]I'm not sure that's the best way to that, like I said, I've been meaning to look into it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.