fluid.fail(message) Section |
---|
Column |
---|
| Causes an error message to be logged to the console and a real runtime error to be thrown. Code Block |
---|
| javascript |
---|
| javascript |
---|
bgColor | white |
---|
borderStyle | nonejavascript |
---|
|
fluid.fail(message);
|
File name: Fluid.js Parameters Span |
---|
| message
| (String|Error) The error message to log |
|
Return Value |
| Example Code Block |
---|
|
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() . |