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); Link to comment https://forums.phpfreaks.com/topic/18620-dom-error-supression/ 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. Link to comment https://forums.phpfreaks.com/topic/18620-dom-error-supression/#findComment-80216 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.