View Full Version : window.onerror in Cordova ?

31 Aug 2012, 8:36 AM

Do you know if window.onerror is supported in Android 2.3 (API 10) using Cordova 1.7 or higher ?.

I'm working on a plugin for logging errors, exceptions etc into a file.

I now for sure that window.onerror works on a Browser environment and I can override that to handle unexpected error messages.

But window.onerror is null when I built an Android project.

Do you know a workaround for this ?


31 Aug 2012, 12:46 PM
It works... but the information given is not relevant. You should generate own conditions, to infer if a particular error has been occurred. In addition, some of them are not fired, especially when an error has occurred in the success/fail callback withing the core (e.g. ondeviceready event). You should either use try-catch or use some kind of timeout/other check. For example - check this issue https://issues.apache.org/jira/browse/CB-964