I know I know....don’t ignore warnings etc
I have found an annoying recurring problem when writing snippets for MODx.
If I try to use @ error suppression the MODx parser error still fires and takes over the page. This is a problem as I may want to more gracefully show the user a message like "Feed unavailable" having tried to retrive an rss feed, failed and then fallen back on a more discreet error?
Is there a way to avoid this happening? The code i’m using:
$doc = new DOMDocument();
$url = ’rssurl’;
if(!@$doc->load($url)){
throw new MyCustomException(’message’);
}
However if the above fails the MODx parser error message takes over my page....