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 |
---|---|
name : | 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
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
name: |
---|
The name of the type of error. Source: javascript/web/pentaho/lang/ArgumentRequiredError.js, line 79 Default Value: "ArgumentRequiredError" Overrides: pentaho.lang.ArgumentError#name |