code: function createCustomError(name, init) {
      assert(name, 'You are trying to register an invalid error');
      var CustomError = function() {
          Error.call(this);
          Error.captureStackTrace(this, CustomError);
          this.name = name;
          if (init) {
              init.apply(this, arguments);
          } else {
              this.message = arguments[0];
          }
      };
      util.inherits(CustomError, Error);
      return CustomError;
  }
docs: **createCustomError** returns the constructor for a custom error type.