3 <title>The source code</title>
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
7 <body onload="prettyPrint();">
8 <pre class="prettyprint lang-js">/*!
10 * Copyright(c) 2006-2009 Ext JS, LLC
12 * http://www.extjs.com/license
14 <div id="method-Ext.Element-handleError"></div>/**
15 * Framework-wide error-handler. Developers can override this method to provide
16 * custom exception-handling. Framework errors will often extend from the base
18 * @param {Object/Error} e The thrown exception object.
20 Ext.handleError = function(e) {
24 <div id="cls-Ext.Error"></div>/**
27 * <p>A base error class. Future implementations are intended to provide more
28 * robust error handling throughout the framework (<b>in the debug build only</b>)
29 * to check for common errors and problems. The messages issued by this class
30 * will aid error checking. Error checks will be automatically removed in the
31 * production build so that performance is not negatively impacted.</p>
32 * <p>Some sample messages currently implemented:</p><pre>
33 "DataProxy attempted to execute an API-action but found an undefined
34 url / function. Please review your Proxy url/api-configuration."
36 "Could not locate your "root" property in your server response.
37 Please review your JsonReader config to ensure the config-property
38 "root" matches the property your server-response. See the JsonReader
39 docs for additional assistance."
41 * <p>An example of the code used for generating error messages:</p><pre><code>
50 function generateError(data) {
51 throw new Ext.Error('foo-error', data);
54 * @param {String} message
56 Ext.Error = function(message) {
57 // Try to read the message from Ext.Error.lang
58 this.message = (this.lang[message]) ? this.lang[message] : message;
60 Ext.Error.prototype = new Error();
61 Ext.apply(Ext.Error.prototype, {
62 // protected. Extensions place their error-strings here.
66 <div id="method-Ext.Error-getName"></div>/**
70 getName : function() {
73 <div id="method-Ext.Error-getMessage"></div>/**
77 getMessage : function() {
80 <div id="method-Ext.Error-toJson"></div>/**
85 return Ext.encode(this);