Continue after Warning
Posted: Thu Sep 10, 2009 12:56 pm
Hi Guys,
I did a basic search and came up empty handed. So I'm hoping you guys can help me out:
I'm doing an HTTP request to twitter to get the number of followers that I have. Everything works great except sometimes the system doesn't respond properly and I get a warning back. Sometimes it's a 404 sometimes I get a valid page but it doesn't contain the DOM element that I'm looking for so I get a warning further down the line at a removeChild call.
I'm cool with getting the warning and I can suppress it with @, but the script stops as if it was a fatal error? Is this expected behavior and if so, is there a way I can continue after getting the warning?
Thanks all in advanced
!
P.S. The original code can be found here at tip #3:
http://www.instantshift.com/2009/05/25/ ... ress-blog/
I did a basic search and came up empty handed. So I'm hoping you guys can help me out:
I'm doing an HTTP request to twitter to get the number of followers that I have. Everything works great except sometimes the system doesn't respond properly and I get a warning back. Sometimes it's a 404 sometimes I get a valid page but it doesn't contain the DOM element that I'm looking for so I get a warning further down the line at a removeChild call.
I'm cool with getting the warning and I can suppress it with @, but the script stops as if it was a fatal error? Is this expected behavior and if so, is there a way I can continue after getting the warning?
Thanks all in advanced
P.S. The original code can be found here at tip #3:
http://www.instantshift.com/2009/05/25/ ... ress-blog/