The debug.setNonUserCodeExceptions property determines whether any try-catch blocks in this scope are to be treated by the debugger as user-unhandled. Exceptions can be classified as thrown, user-unhandled or unhandled.


Debug.setNonUserCodeExceptions [= bool];


If this property is set to true within a given scope, the debugger can then choose whether to take some specified action on exceptions thrown inside that scope: for instance, if the developer wishes to break on user-unhandled exceptions. Setting this property to false is the same as never having set the property.

For more information on debugging, see the Active Script Debugging Overview.


The following code shows how to set this property.

(function () {  
    Debug.setNonUserCodeExceptions = true;  
        var x = null;  
    } catch (e) {  
    // Catch the exception.  


Supported in the following document modes: Internet Explorer 10 standards and Internet Explorer 11 standards. Also supported in Store apps (Windows 8 and Windows Phone 8.1).
Not supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards.

See also