Adobe ColdFusion 8

CCFXRequest::ThrowException

Syntax

void CCFXRequest::ThrowException(LPCSTR lpszError, LPCSTR lpszDiagnostics)

Description

Throws an exception and ends processing of a request. Call this function when you encounter an error that does not allow you to continue processing the request. This function is almost always combined with the CCFXRequest::ReThrowException to protect against resource leaks in extension code.

Parameters

Parameter

Description

lpszError

Short identifier for error

lpszDiagnostics

Error diagnostic information

Example

The following example throws an exception indicating that an unexpected error occurred while processing a request:

char buffError[512] ;
    wsprintf( buffError,
            "Unexpected Windows NT error number %ld "
            "occurred while processing request.", GetLastError() ) ;
     
    pRequest->ThrowException( "Error occurred", buffError ) ;