Skip navigation FileNet logo
  Open Client Developer's Guide
  Search  |  Index  |  Glossary   |  
Open menu Overview
Open menu Open Client Architecture
Open menu Developing for Process
Close menu Error and Exception Handling
  Open menu Error Handling
  Close menu Exception Handling
    Defining a New Exception
    Error Helper Functions
    Handling Guidelines
    Handling COMException
    Logging Exceptions
Open menu Customizing the Framework
Globalization / Localization
Open menu General Information
   

Exception Handling Guidelines

Exception Raising Guidelines

Developers are recommended to follow these guidelines when raising exceptions:

  • Always throw exceptions, rather than simply returning an error code or HRESULT.
  • Use inner exceptions or chained exceptions, to enable the previous exception to be notified of the new error exception.
  • When using inner exceptions, try to maintain a short chain of exception.
  • Be aware that the stack trace begins when the exception is thrown. The stack trace starts from where the exception is thrown, not where it is newed.
  • Always use helper functions to handle exceptions. Classes frequently throw the same exception from different places within the implementation.

Exception Handling Guidelines

Developers are recommended to follow these guidelines when handling exceptions:

  • Follow the steps for creating structured code statements.
  • Always use helper functions to handle exceptions. Classes frequently throw the same exception from different places within the implementation.
  • Only handle the exception in the foundation class, when you know how to recover from the exception. Otherwise, pass the exception up to the parent in the second parameter, along with any additional information.
  • To display the error messages, use the HandleException function defined in the  FnError object, can be used to redirect the ASPX Page container to the Error Page. The Error Page will display the stack trace for each error using a consistent format.