Class type Ext_Error.statics


class type statics = object .. end

method ignore : bool Js.t Js.prop

Static flag that can be used to globally disable error reporting to the browser if set to true (defaults to false). Note that if you ignore Ext errors it's likely that some other code may fail and throw a native JavaScript error thereafter, so use with caution. In most cases it will probably be preferable to supply a custom error handling function instead.

Example usage:

Ext.Error.ignore = true;

Defaults to: false

method notify : bool Js.t Js.prop

Static flag that can be used to globally control error notification to the user. Unlike Ex.Error.ignore, this does not effect exceptions. They are still thrown. This value can be set to false to disable the alert notification (default is true for IE6 and IE7).

Only the first error will generate an alert. Internally this flag is set to false when the first error occurs prior to displaying the alert.

This flag is not used in a release build.

Example usage:

Ext.Error.notify = false;

method handle : 'a. 'a Js.t -> unit Js.meth

Globally handle any Ext errors that may be raised, optionally providing custom logic to handle different errors individually. Return true from the function to bypass throwing the error to the browser, otherwise the error will be thrown and execution will halt.

Example usage:

Ext.Error.handle = function(err) {
    if (err.someProperty == 'NotReallyAnError') {
        // maybe log something to the application here if applicable
        return true;
    }
    // any non-true return value (including none) will cause the error to be thrown
}

Parameters:


method _raise : 'b. 'b Js.t -> unit Js.meth

Raise an error that can include additional data and supports automatic console logging if available. You can pass a string error message or an object with the msg attribute which will be used as the error message. The object can contain any other name-value attributes (or objects) to be logged along with the error.

Note that after displaying the error message a JavaScript error will ultimately be thrown so that execution will halt.

Example usage:

Ext.Error.raise('A simple string error message');

// or...

Ext.define('Ext.Foo', {
    doSomething: function(option){
        if (someCondition === false) {
            Ext.Error.raise({
                msg: 'You cannot do that!',
                option: option,   // whatever was passed into the method
                'error code': 100 // other arbitrary info
            });
        }
    }
});

Parameters: