The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

stackTraceLimit Property (Error) (JavaScript)

Gets or sets the stack trace limit, which is equivalent to the number of error frames to display. The default limit is 10.


You can set the stackTraceLimit property to any positive value between 0 and Infinity. If the stackTraceLimit property is set to 0 at the time an error is thrown, no stack trace is shown. If the property is set to a negative value or a non-numeric value, the value is converted to 0. If the stackTraceLimit is set to Infinity, the entire stack is shown. Otherwise, ToUint32 is used to convert the value.

The following example shows how to set and then get the stack trace limit.

    var err = new Error("my error");
    Error.stackTraceLimit = 7;
    throw err;
    document.write ("Error stack trace limit: ")
    document.write (Error.stackTraceLimit);

Supported in Internet Explorer 10 and in Windows Store apps.

Applies To: Error Object (JavaScript)

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft