Advanced Customization > Info*Engine User’s Guide > Info*Engine Custom Tag Reference > Info*Engine Tags > Core Library Tags > failure
  
failure
The failure tag allows you to supply code for failure processing within a unit. The code between the start and end failure tag executes only when the body of the unit does not complete successfully. You can include multiple failure tag blocks in a unit:
To include general failure processing, specify the failure tag with no attributes.
To include code for processing a specific exception, specify the failure tag with the name of the exception in the exception attribute.
If you do not include a failure tag block for processing an error that occurs in the body of a unit, no failure processing occurs and the page continues to be processed following the unit end tag.
You nest this tag in unit tag blocks. To provide failure code sets for specific errors, you can specify multiple failure tag blocks. On each failure tag, you can name a specific error in the exception attribute. You can nest multiple webject, task, unit, and parallel tags in this tag block.
To manage exceptions within a failure tag block, you can include the Throw-Exception webject. Including this webject is a way to propagate (rethrow) exceptions that are caught by failure tags. You can simply add the following in the block:
<ie:webject name="Throw-Exception" type="MGT"/>
Including this webject causes the caught exception to be rethrown. Rethrowing exceptions is useful when unit blocks are nested or when you want exceptions caught in a unit block to be passed on to the page.
If an exception occurs in a failure tag block, the exception is propagated outside the unit block.
Scriptlets that are nested in unit, init, success, and failure tag blocks are not processed on JSP pages the same way they are processed in the Info*Engine task processor. Use the following guidelines to determine when you can nest scriptlets in these tags:
You can nest scriptlets within tag blocks in a standalone task.
You should not nest scriptlets in any tag block on a JSP page. Instead, create standalone tasks that contain the scriptlets. You can execute these tasks from the JSP page by using the Info*Engine task tag.
For additional information about scriptlets, see Scriptlets.
* 
Embedded HTML is not supported within failure tags in JSPs.
Syntax
<ie:failure exception="exception_name">
.
. (webject, task, unit, or parallel tag blocks)
.
</ie:failure>
Attribute Descriptions
exception
Specifies a Java exception name for limiting the access to the failure processing code. When this attribute is included, the failure block is executed only when the exception named has occurred.
If you omit this attribute, the exception name is assumed to be “java.lang.Exception.”
Example
The following example declares that the page uses tags from the Info*Engine core tag library and that the tags have the ie prefix. The following failure tags provide general error processing for the unit and specific error processing for the IENotFoundException exception:
<%@ taglib uri="http://www.ptc.com/infoengine/taglib/core"
prefix="ie" %>

<ie:unit>

<ie:failure
exception="com.infoengine.exception.fatal.IENotFoundException">
<!-- specific failure processing for IENotFoundException-->
</ie:failure>

<ie:failure>
<!--Add general failure processing here. -->
</ie:failure>

</ie:unit>