I am loading HTML / JS from a subdirectory of the document directory on an iPad in UIWebView. So far, everything is working fine. To debug the JS-Part, I added several alert(..); statements alert(..); to js file. In most cases, there are no problems with these warnings, but from time to time an error occurs in the console, and the application crashes:
WebKit discarded an uncaught exception in the webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame: delegate: <(null)> A route has already been registered for class 'Publication' and HTTP method 'ANY'
Question 1: What could be the problem? I mean ... this is a simple warning (); which seems to be causing this error in the console.
Question 2: can I catch these errors in my application? This way the application will not crash due to a simple JS () warning;
thanks
source share