Skip to main content
Pentaho Documentation

OperationInvalidError

pentaho.lang.OperationInvalidError

The OperationInvalidError class is the class of errors that signals that performing an operation is considered invalid.

Performing an operation can be considered invalid when:

  • The object in which it is executed is not in a state that allows the operation to be performed. For exampel: it is locked, busy or disposed.
  • It cannot be performed on a certain type of object.

AMD Module

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

Extends

Constructor

Name Description
new OperationInvalidError(reason)

Creates an invalid operation error object.

Members

Name Description
name : string

The name of the type of error.

Constructor Details

new OperationInvalidError(reason)

Creates an invalid operation error object.

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

Parameters:
Name Default Value Summary
reason : string

Text that explains the reason why performing the operation is considered invalid.

Example

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

 function Cell(value) {
 this._value = value;
 this._locked = false;
 }

 Cell.prototype = {
 lock: function() {
 this._locked = true;
 },

 get value() {
 return this._value;
 },

 set value(v) {
 if(this._locked) {
 throw new OperationInvalid("Cell is locked.");
 }

 this._value = v;
 }
 };

 // ...
});

Members Details

name: string

The name of the type of error.

Source: javascript/web/pentaho/lang/OperationInvalidError.js, line 85

Default Value: "OperationInvalidError"