Advanced Customization > Info*Engine User’s Guide > Info*Engine JSP Pages > Catching Exceptions > Using unit Tags
  
Using unit Tags
You can catch exceptions within specific parts of a page by using unit tags on the page and including one or more failure blocks within the unit. In the previous section, the failure block provided was for all failures. In addition to having a general failure block, you can have failure blocks that catch a specific exception. The following failure blocks catch four different exceptions:
<ie:failure exception="AdapterException">
  <ie:webject name="Create-Group" type="GRP">
    <ie:param name="ELEMENT"  data="FAILURE=AdapterError"/>
    <ie:param name="DELIMITER"  data=":"/>
    <ie:param name="GROUP_OUT"  data="failure"/>
  </ie:webject>
   <ie:webject name="Object-XML" type="DSP"/>
</ie:failure>

<ie:failure exception="IEPartialResultsException">
  <ie:webject name="Create-Group" type="GRP">
    <ie:param name="ELEMENT"  data="FAILURE=PartialResults"/>
    <ie:param name="DELIMITER"  data=":"/>
    <ie:param name="GROUP_OUT"  data="failure"/>
  </ie:webject>
  <ie:webject name="Object-XML" type="DSP"/>
</ie:failure>

<ie:failure exception="IEInternalServiceException">
  <ie:webject name="Create-Group" type="GRP">
    <ie:param name="ELEMENT"
              data="FAILURE=InternalServiceError"/>
    <ie:param name="DELIMITER"  data=":"/>
    <ie:param name="GROUP_OUT"  data="failure"/>
  </ie:webject>
  <ie:webject name="Object-XML" type="DSP"/>
</ie:failure>

<ie:failure exception="IEFatalException">
  <ie:webject name="Create-Group" type="GRP">
    <ie:param name="ELEMENT"  data="FAILURE=FatalException"/>
    <ie:param name="DELIMITER"  data=":"/>
    <ie:param name="GROUP_OUT"  data="failure"/>
  </ie:webject>
  <ie:webject name="Object-XML" type="DSP"/>
</ie:failure>
You can also use the Throw-Exception webject to throw your own exceptions or rethrow an exception from within a page or a task. All exceptions thrown during task webject execution are automatically entered in the SERVER context group as the attributes named exception-class and exception-message. Therefore, you can use the Throw-Exception webject to rethrow and exception and its message without knowing what the exception is.