1 var Event = require('./Event.js').Event;
  2 var Class = require("../../mootools/mootools-node.js").Class;
  3 
  4 /**
  5  * @class ErrorEvent
  6  * @extends Event
  7  * @requires Class
  8  * @requires Event
  9  *
 10  * @param {String} type
 11  * @param {Object} data
 12  * @param {Number} code
 13  * @param {String} message
 14  */
 15 var ErrorEvent = function() {
 16     
 17     /** @ignore */
 18 	this.Extends = Event;
 19 
 20     /**
 21      * @property {Number} code
 22      */
 23 	this.code = 0;
 24 
 25     /**
 26      * @property {String} message
 27      */
 28 	this.message = null;
 29 
 30 
 31     /** @ignore */
 32 	this.initialize = function(type, data, code, message) {
 33 		this.parent(type, data);
 34 		this.code = code;
 35 		this.message = message;
 36 	};
 37 
 38 
 39     /**
 40      * Displays error as html content
 41      * @return {String}
 42      */
 43     this.toHtmlString = function(){
 44         var retVal = "<pre>";
 45         for(el in this){
 46             if(this.hasOwnProperty(el) && typeof this[el]!='function' ){
 47                 retVal+="\t" + el+': '+this[el]+"\n";
 48             }
 49         }
 50         retVal += "</pre>";
 51         return retVal;
 52     };
 53     
 54 };
 55 
 56 ErrorEvent = new Class(new ErrorEvent());
 57 exports.ErrorEvent = ErrorEvent;
 58