how to log the which line cause the error in the javascript

You must Login before you can answer or comment on any questions.

titanium sdk: 2.1.1

platform: android

os: mac os

i'm using ddms to trace the error in my app, i create a filter with 'by Log Tag' as 'Ti'. the question is every time the error happens, only the trace for java, but nothing for the js file. Sometimes i want to know which js file cause the error, or even more exact, which line in the js cause the error, is it possible?

...
10-21 16:40:34.835: E/TiApplication(29085):     at android.view.View.layout(View.java:11418)
10-21 16:40:34.835: E/TiApplication(29085):     at android.view.ViewGroup.layout(ViewGroup.java:4224)
10-21 16:40:34.835: E/TiApplication(29085):     at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
10-21 16:40:34.835: E/TiApplication(29085):     at android.view.View.layout(View.java:11418)
10-21 16:40:34.835: E/TiApplication(29085):     at android.view.ViewGroup.layout(ViewGroup.java:4224)
...

— asked 8 months ago by kent hao
0 Comments

1 Answer

As long as you're testing something that works in the emulator, you can use the built in debugger to step through the section of the app giving you problems.

Ray

— answered 8 months ago by Ray Belisle
answer permalink
2 Comments
  • the problem is that android simulator is too slow to work. and often, a lot of errors of the simulator itself. so i give up using it.

    — commented 8 months ago by kent hao

  • Hmm.... the only other thing I could suggest is that if you know where in the app the error is happening, put Ti.API.info calls around your code. This way they will show up in DDMS and you can view them.

    — commented 8 months ago by Ray Belisle

Your Answer

Think you can help? Login to answer this question!