3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
8 * Framework-wide error-handler. Developers can override this method to provide
9 * custom exception-handling. Framework errors will often extend from the base
11 * @param {Object/Error} e The thrown exception object.
13 Ext.handleError = function(e) {
20 * <p>A base error class. Future implementations are intended to provide more
21 * robust error handling throughout the framework (<b>in the debug build only</b>)
22 * to check for common errors and problems. The messages issued by this class
23 * will aid error checking. Error checks will be automatically removed in the
24 * production build so that performance is not negatively impacted.</p>
25 * <p>Some sample messages currently implemented:</p><pre>
26 "DataProxy attempted to execute an API-action but found an undefined
27 url / function. Please review your Proxy url/api-configuration."
29 "Could not locate your "root" property in your server response.
30 Please review your JsonReader config to ensure the config-property
31 "root" matches the property your server-response. See the JsonReader
32 docs for additional assistance."
34 * <p>An example of the code used for generating error messages:</p><pre><code>
43 function generateError(data) {
44 throw new Ext.Error('foo-error', data);
47 * @param {String} message
49 Ext.Error = function(message) {
50 // Try to read the message from Ext.Error.lang
51 this.message = (this.lang[message]) ? this.lang[message] : message;
53 Ext.Error.prototype = new Error();
54 Ext.apply(Ext.Error.prototype, {
55 // protected. Extensions place their error-strings here.
63 getName : function() {
70 getMessage : function() {
78 return Ext.encode(this);