CCFXRequest::ReThrowException  
 
 
void CCFXRequest::ReThrowException(CCFXException* e)

Re-throws an exception that has been caught within an extension procedure. This function is used to avoid having C++ exceptions thrown by DLL extension code propagate back into ColdFusion. You should catch ALL C++ exceptions that occur in your extension code and then either re-throw them (if they are of the CCFXException class) or create and throw a new exception using ThrowException.

e

An existing CCFXException that has been caught.

 
 
  Example  
 

The following code demonstrates the correct way to handle exceptions in ColdFusion Extension DLL procedures:

try
{
 
        ...Code which could throw an exception...
 
}
catch( CCFXException* e )
{
        ...Do appropriate resource cleanup here...
 
        // Re-throw the exception
        pRequest->ReThrowException( e ) ;
}
catch( ... )
{
        // Something nasty happened, don't even try
        // to do resource cleanup
 
        pRequest->ThrowException(
            "Unexpected error occurred in CFX tag", "" ) ;
}


 
 
BackUp LevelNext
 
 

allaire     AllaireDoc@allaire.com
    Copyright © 1998, Allaire Corporation. All rights reserved.