Complete
over 4 years ago

WERETECH-6805

This was addressed in CIQ 3.1.1.

How to debug an unhandled exception

On a fresh Eclipse install on macOS High Sierra with recommended settings (several example apps do build and run), I can't seem to get a strack trace after an unhandled exception (aka app crash). Without that information, it's pretty much impossible to debug an app, so I guess I just missed some setting.

What did I miss?
Former Member
Former Member
Parents
  • Using this code: function initialize() { WatchFace.initialize(); var fun=method(:foo); if(fun.invoke()) {System.println("true");} } function foo() { System.println("in foo"); return ""; } I don't see any problem/exception with 3.0.8 and a 645 target. I'd expect the "if" to be true (as it's not "false") The output is: in foo true Is there something else in your code you didn't say, like different classes or something? update: Ok, I missed the "!" and see it now.... But with a try/catch, you see it: try { if(!fun.invoke()){System.println("true");} } catch(e) { System.println("e="+e.getErrorMessage()); } e=UnexpectedTypeException: Expected Number/Boolean/Long, given String It does seem that you should see the exception without the try/catch though
Comment
  • Using this code: function initialize() { WatchFace.initialize(); var fun=method(:foo); if(fun.invoke()) {System.println("true");} } function foo() { System.println("in foo"); return ""; } I don't see any problem/exception with 3.0.8 and a 645 target. I'd expect the "if" to be true (as it's not "false") The output is: in foo true Is there something else in your code you didn't say, like different classes or something? update: Ok, I missed the "!" and see it now.... But with a try/catch, you see it: try { if(!fun.invoke()){System.println("true");} } catch(e) { System.println("e="+e.getErrorMessage()); } e=UnexpectedTypeException: Expected Number/Boolean/Long, given String It does seem that you should see the exception without the try/catch though
Children
No Data