Skip to main content

Pentaho+ documentation is moving!

The new product documentation portal is here. Check it out now at docs.hitachivantara.com

 

Hitachi Vantara Lumada and Pentaho Documentation

ArgumentRequiredError

pentaho.lang. ArgumentRequiredError

The ArgumentRequiredError class is the class of errors for a function's argument that was required but was not specified, or was specified but with a nully or empty value.

The name of the argument can be that of a nested property. For example: "keyArgs.description".

An argument being "required" may mean that an argument must be:

  • Specified: if(arguments.length < 1) ...
  • Truthy: if(!value) ...
  • Not nully: if(value == null) ...
  • Not nully or an empty string: if(value == null || value === "") ...

AMD Module

require(["pentaho/lang/ArgumentRequiredError"], function(ArgumentRequiredError) { /* code goes here */ });

Extends

Constructor

Name Description
new ArgumentRequiredError(name, text)

Creates a required argument error object.

Members

Name Description
argument :  string

The name of the associated argument.

name :  string

The name of the type of error.

Constructor Details

new ArgumentRequiredError(name, text)

Creates a required argument error object.

Source: javascript/web/pentaho/lang/ArgumentRequiredError.js, line 25

Parameters:
Name Default Value Summary
name : string

The name of the argument.

text : string
Optional

Optional text further explaining the reason why the argument is required. Can be useful when "being required" is a dynamic rule.

Example

define(["pentaho/lang/ArgumentRequiredError"], function(ArgumentRequiredError) {

 function connect(channel) {

 if(channel && channel.isOpened) {
 throw new ArgumentRequiredError("channel", "Channel not free to use.");
 }

 var handle = channel.open();
 // ...
 }

 // ...
});

Members Details

argument:  string

The name of the associated argument.

Source: javascript/web/pentaho/lang/ArgumentError.js, line 49

Inherited From: pentaho.lang.ArgumentError#constructor#argument

name:  string

The name of the type of error.

Source: javascript/web/pentaho/lang/ArgumentRequiredError.js, line 79

Default Value: "ArgumentRequiredError"

Overrides: pentaho.lang.ArgumentError#name