-
16 Jan 2013 1:53 AM #1
Unanswered: Obtaining call stack programatically
Unanswered: Obtaining call stack programatically
Hi All,
I am trying to detect a tricky and hard to reproduce issue in my code and I need to obtain call stack programmatically. Is there anything is ext-js-4 that could help in doing that?
Regards,
Bartek
-
17 Jan 2013 1:56 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
- Answers
- 3106
You can use a try/catch block
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
18 Jan 2013 1:21 AM #3
Hmmm - there is no exception involved - it is more about seeing from where certain methods are invoked and why. So if they get called and hist certain condition I would like to see the full call stack in an alert or logs.
-
18 Jan 2013 2:31 AM #4
If you just want to kick off the debugger you can add a breakpoint or use the debugger statement in your code. Most browsers support conditional breakpoints so that they only pause execution if some condition is met.
However, to answer your question directly:
Code:var stack = new Error().stack
-
18 Jan 2013 4:02 AM #5Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
- Answers
- 3106
You can google for 'javascript stack trace' and you will find quite a few pages on different ways to do it.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
21 Jan 2013 5:30 AM #6
Since I need to capture a stacktrace when the issue happens and there is a very little chance to do so when debugger is on I used the following library: https://github.com/eriwen/javascript-stacktrace


Reply With Quote