Class: InvalidArgumentError

H.lang.InvalidArgumentError

new H.lang.InvalidArgumentError (opt_caller, opt_argNr, opt_message)

This class encapsulates an error to throw if an argument is invalid.

Name Type Description
opt_caller function optional

The calling function

opt_argNr number optional

The index of the invalid argument (zero based)

opt_message * optional

The text of the error message to output

Example
H.Foo = function() {};
H.Foo.prototype.bar = function(x) {
  throw new H.lang.InvalidArgumentError(this.bar, 0, 'is invalid');
}
new H.Foo().bar(123); // ==> InvalidArgumentError: H.Foo#bar (Argument #0 is invalid)