Skip to main content
opera support added
Source Link
Eli Grey
  • 36k
  • 14
  • 80
  • 96

You can access the stack (stacktrace in Opera) properties of an Error instance even if you threw it. The thing is, you need to make sure you use throw new Error(string) (don't forget the new instead of throw string.

Example:

vartry err{  = new Error, 0++; stacktrace} catch (e) { var myStackTrace = erre.stack || erre.stacktrace;stacktrace || ""; } 

You can access the stack (stacktrace in Opera) properties of an Error instance even if you threw it. The thing is, you need to make sure you use throw new Error(string) (don't forget the new instead of throw string.

Example:

var err = new Error, stacktrace = err.stack || err.stacktrace; 

You can access the stack (stacktrace in Opera) properties of an Error instance even if you threw it. The thing is, you need to make sure you use throw new Error(string) (don't forget the new instead of throw string.

Example:

try {   0++; } catch (e) { var myStackTrace = e.stack || e.stacktrace || ""; } 
Source Link
Eli Grey
  • 36k
  • 14
  • 80
  • 96

You can access the stack (stacktrace in Opera) properties of an Error instance even if you threw it. The thing is, you need to make sure you use throw new Error(string) (don't forget the new instead of throw string.

Example:

var err = new Error, stacktrace = err.stack || err.stacktrace;