PageRenderTime 50ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/workshops/geoext/src/ext/docs/source/Error.html

https://github.com/geobeyond/workshops
HTML | 92 lines | 89 code | 3 blank | 0 comment | 0 complexity | cd345efcffe62f2e9c104f4a801a5952 MD5 | raw file
Possible License(s): GPL-3.0, BSD-3-Clause, Apache-2.0
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>The source code</title>
  5. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  6. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*!
  10. * Ext JS Library 3.3.1
  11. * Copyright(c) 2006-2010 Sencha Inc.
  12. * licensing@sencha.com
  13. * http://www.sencha.com/license
  14. */
  15. <div id="method-Ext.Element-handleError"></div>/**
  16. * Framework-wide error-handler. Developers can override this method to provide
  17. * custom exception-handling. Framework errors will often extend from the base
  18. * Ext.Error class.
  19. * @param {Object/Error} e The thrown exception object.
  20. */
  21. Ext.handleError = function(e) {
  22. throw e;
  23. };
  24. <div id="cls-Ext.Error"></div>/**
  25. * @class Ext.Error
  26. * @extends Error
  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."
  35. * </pre><pre>
  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."
  40. * </pre>
  41. * <p>An example of the code used for generating error messages:</p><pre><code>
  42. try {
  43. generateError({
  44. foo: 'bar'
  45. });
  46. }
  47. catch (e) {
  48. console.error(e);
  49. }
  50. function generateError(data) {
  51. throw new Ext.Error('foo-error', data);
  52. }
  53. * </code></pre>
  54. * @param {String} message
  55. */
  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;
  59. };
  60. Ext.Error.prototype = new Error();
  61. Ext.apply(Ext.Error.prototype, {
  62. // protected. Extensions place their error-strings here.
  63. lang: {},
  64. name: 'Ext.Error',
  65. <div id="method-Ext.Error-getName"></div>/**
  66. * getName
  67. * @return {String}
  68. */
  69. getName : function() {
  70. return this.name;
  71. },
  72. <div id="method-Ext.Error-getMessage"></div>/**
  73. * getMessage
  74. * @return {String}
  75. */
  76. getMessage : function() {
  77. return this.message;
  78. },
  79. <div id="method-Ext.Error-toJson"></div>/**
  80. * toJson
  81. * @return {String}
  82. */
  83. toJson : function() {
  84. return Ext.encode(this);
  85. }
  86. });
  87. </pre>
  88. </body>
  89. </html>