Jump to content

DOM Error supression


pkrtech

Recommended Posts

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]<?php
if(!@$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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.