0

I'm using the apigee JS SDK for web development. When I'm trying to debug in my web browser, it's really frustrating, since the Javascript console logs page and row number seems to get overwritten. See the image below. Instead of saying user.js:65 it will say apigee.js:2975, for every single error. It makes it much harder to debug. Is there any way around this?

enter image description here

The Jonas Persson
  • 1,726
  • 1
  • 17
  • 36
  • Have a look here: http://stackoverflow.com/questions/591857/how-can-i-get-a-javascript-stack-trace-when-i-throw-an-exception – brandonscript Jan 13 '14 at 18:44

1 Answers1

2

If you have the arrow on the left side of the error you can expand and see the full stack.

https://developers.google.com/chrome-developer-tools/docs/javascript-debugging?hl=zh-TW#viewing-exception-stack-trace

ShawnF
  • 41
  • 2
  • The problem is that it's not only on the errors, where you are right, I can look at the stack trace. But I would like to see where I'm calling my `console.log` as well, and the log doesn't have a stack trace. – The Jonas Persson Jan 14 '14 at 15:07
  • TypeError's get automatically logged in the browser console so you probably aren't calling console.log in this case. Wrapping in a try catch would let you catch the error if it's not occurring asynchronously. If it is then your best bet is to debug your way through the function call or to put a breakpoint on the line number where the error is getting thrown. – ShawnF Jan 14 '14 at 19:41