{div:class=api-page}

h1. fluid.fail(message)
{section}
{column:width=70%}

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

{code:javascript|borderStyle=none|bgColor=white}
fluid.fail(message);
{code}

*File name:* {{Fluid.js}}

h2. Parameters

{span:class=borderless-table}
|*{{message}}*| (String\|Error) The error message to log |{span}

h2. Return Value
{span:class=borderless-table}
|*none*|
{span}

{column}

{column:width=5%}
{column}

{column}
h3. See Also

{column}
{section}
----

h3. Example
{code:javascript}
var inputField = that.locate("inputField");
if (inputField.lengh === 0) {
    fluid.fail("No input field was found."); 
}
{code}
In this example, a component [Infusion13: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()}}.

{div}