Getting the stack trace of an error


when catch error, able log stack trace. far i’ve come little trick:

 

error.prototype.tostring = function() {     if (typeof this.stack === "undefined" || this.stack === null) {         this.stack = "placeholder";         // previous line needed because next line may indirectly call method.         this.stack = $.stack;     }     return "error"; } 

 

this attaches stack manually-created error. example, can run:

 

try {     throw new error("i'm error."); } catch (e) {     $.writeln("stack: " + e.stack); } 

 

and print correct stack error. however, works errors create. there way stack trace of error?

 

full disclosure: i’ve asked on stack overflow without success. see here more info: http://stackoverflow.com/questions/16201574/getting-the-stack-trace-of-an-error-in-extends cript

hei!

 

in extendscript there problems when extending objects. not sure error 1 of them, problem sure looks that.

here great source of info:

 

http://forums.adobe.com/message/4133138#4133138



More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account