3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js"><div id="method-Ext.Element-handleError"></div>/**
9 * Framework-wide error-handler. Developers can override this method to provide
10 * custom exception-handling. Framework errors will often extend from the base
12 * @param {Object/Error} e The thrown exception object.
14 Ext.handleError = function(e) {
18 <div id="cls-Ext.Error"></div>/**
21 * <p>A base error class. Future implementations are intended to provide more
22 * robust error handling throughout the framework (<b>in the debug build only</b>)
23 * to check for common errors and problems. The messages issued by this class
24 * will aid error checking. Error checks will be automatically removed in the
25 * production build so that performance is not negatively impacted.</p>
26 * <p>Some sample messages currently implemented:</p><pre>
27 "DataProxy attempted to execute an API-action but found an undefined
28 url / function. Please review your Proxy url/api-configuration."
30 "Could not locate your "root" property in your server response.
31 Please review your JsonReader config to ensure the config-property
32 "root" matches the property your server-response. See the JsonReader
33 docs for additional assistance."
35 * <p>An example of the code used for generating error messages:</p><pre><code>
44 function generateError(data) {
45 throw new Ext.Error('foo-error', data);
48 * @param {String} message
50 Ext.Error = function(message) {
51 // Try to read the message from Ext.Error.lang
52 this.message = (this.lang[message]) ? this.lang[message] : message;
54 Ext.Error.prototype = new Error();
55 Ext.apply(Ext.Error.prototype, {
56 // protected. Extensions place their error-strings here.
60 <div id="method-Ext.Error-getName"></div>/**
64 getName : function() {
67 <div id="method-Ext.Error-getMessage"></div>/**
71 getMessage : function() {
74 <div id="method-Ext.Error-toJson"></div>/**
79 return Ext.encode(this);