How do i keep a caught exception from reporting as uncaught in a blackberry app?

て烟熏妆下的殇ゞ 提交于 2019-12-11 01:41:39

问题


Edit: this applies to simulators only, but i would still like to know if there is a resolution.

I have some code in a blackberry application that catches an exception at some point, does some handling in the catch block then rethrows the exception, which is caught higher up on the call stack. However even though i do catch it later on, i still see an error message displayed on the simulator, along with a jvm 104 error in the device logs. Is there something else i need to do to suppress this error screen from displaying when i already catch the exception it's complaining about?


回答1:


Have you tried the JDE Preferences menu, Simulator tab, Debugging subtab? There's an option in there labeled "Do not stop execution when an exception is caught by catch(Throwable)". Maybe that would do it? (This assumes that you launch the simulator from the JDE)




回答2:


Are you actually doing a catch(Throwable)? As Marc says, that'll show up in the error logs on the simulator. RIM discourages doing things that way as you take a performance hit (I'll avoid ranting about their JVM design), so that may be another reason to solve this by just catching things a different way (e.g. not Throwable but a more specific exception type - unless you really need that stack trace).



来源:https://stackoverflow.com/questions/538778/how-do-i-keep-a-caught-exception-from-reporting-as-uncaught-in-a-blackberry-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!