code: function(name,options) {
      var cls = new Class(name,options);
      var custom = new Class("CustomError",{
        inherits: Error,
        constructor: function(message) {
          this.name = name;
          this.message = message;
        },
      })
      cls.inherit(custom);
      return cls.toFunction();
    }
docs: .createError(name,options)