I am working on a SharePoint app where there are tons of Javascripts on the page some by me, by other developers and some are third party scripts.
The problem is some of the third party scripts are not properly catching their exceptions and that breaks all the rest of the scripts on the page.
Is there really a way to observe and catch unhandled exceptions thrown by other scripts so that I can take appropriate action?
For example, we are using a grid provided by TreeGrid and in certain situations, it is not able to set the rel value of the stylesheet. Would it be possible for me to catch this exception and set the rel value of that particular stylesheet?
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
Timestamp: Wed, 7 Dec 2011 19:07:14 UTC
Message: Could not set the rel property. Invalid property value.
Line: 1
Char: 1
Code: 0
URI: http://localdev/sites/westd/default.aspx
Thanks a lot in looking into this 🙂
from this page
I woudn’t recommend using
onerrorit for anything important – but to solve a problem with 3rd parties, I guess it’s ok.