Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Div
classapi-page

fluid.fail(message)

Section
Column
width70%

Causes an error message to be logged to the console and a real runtime error to be thrown.

Code Block
javascript
javascript
bgColorwhite
borderStylenonejavascript
fluid.fail(message);

File name: Fluid.js

Parameters

Span
classborderless-table

message

(String|Error) The error message to log

Return Value

Span
classborderless-table

none

Column
width5%
 
Column

See Also


Example

Code Block
javascript
javascript
var inputField = that.locate("inputField");
if (inputField.lengh === 0) {
    fluid.fail("No input field was found."); 
}

In this example, a component DOM Binder locate function is used to find the element specified by the inputField selector. If no such element is found, an error is thrown using fluid.fail().