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", "" ) ;
}
|