Redirecting Error Messages

FlashConnect allows redirecting categories of error messages to a specified URL, providing the ability to trap error messages on the Web server and apply custom error-handling techniques. The redirection parameters are specified from the FlashConnect configuration utility:

For UNIX: The parameters in the FlashConnect.conf file are shown below:

RedirectParametersPath=

NoFCServiceException=

NoServerException=

PipeException=

SocketException=

ProtocolException=

PersistentTimeoutException=

InvalidParameterException=

MemoryException=

UncategorizedException=

For Windows: Select Start > Programs > TigerLogic > FlashConnect > Configure from the Start menu.

The FlashConnect Configuration dialog box displays (parameters are specified from the Error Handling tab):

The RedirectParametersPath parameter (Directory for temporary files in Windows) specifies the path in which to create a text file that contains the name and value pair parameters of the error as well as the W3EXCEPTIONERROR and W3EXCEPTIONTEXT variables (generated by the error). The text file is appended and sent to the URL of the specified error.

All other parameters specify the redirect URL for the specified error type.

For example, assume these values are set in the FlashConnect configuration file:

RedirectParametersPath=/tmp

NoServerException=http://localhost/cgi-bin/nofcserver.pl

If fccgi.exe and FCisapi encounter a NoServerException error a text file is created and appended to the URL specified in the NoServerException path, resulting in this format:

http://localhost/cgi-bin/nofcserver.pl?/tmp/filename.txt

where filename is a randomly generated 10 character string (for example, jaofvhznwx). The random generation ensures that each file name is unique.

NOTE

  • An automatically generated question mark (?) separates the error path and the appended text file.

  • In this example, the path specified in the NoServerException actually calls a PERL program. This allows you to create a custom program (PERL or other) for handling the data passed.

  • Because each new text file generated is unique, it is good practice to occasionally delete old files from the directory.

Parameter(s)

Parameter (UNIX)

Parameter (Windows)

Description

RedirectParametersPath

Directory for temporary files

Specifies the path in which to create a text file that contains the name and value pair parameters of the error as well as the W3EXCEPTIONERROR and W3EXCEPTIONTEXT variables (generated by the error). This text file is then appended to the URL of the specified error. If left null (default), the text file is not created and nothing is appended to the URL.

NoFCServiceException

NoFCService

Specifies the redirect URL for FCService not running errors.

NoServerException

NoServer

Specifies the redirect URL for server pool not found errors.

PipeException

Pipe

Specifies the redirect URL for pipe errors.

SocketException

Socket

Specifies the redirect URL for socket errors.

ProtocolException

Protocol

Specifies the redirect URL for protocol errors.

PersistentTimeoutException

PersistentTimeout

Specifies the redirect URL for persistent timeout errors.

InvalidParameterException

InvalidParameter

Specifies the redirect URL for invalid ISAPI parameter errors.

MemoryException

Memory

Specifies the redirect URL for memory exception errors.

UncategorizedException=

Uncategorized

Specifies the redirect URL for uncategorized exception errors.

Example

#!/usr/bin/perl

#

# There has been a FlashConnect exception redirected here.

# Generate a web page showing all available info.

# Start with the cgi interface

print "content-type: text/html\n\n";

 

# Now the html tag

print "<HTML>

print "<HEAD><TITLE>Perl processing of redirection</TITLE></HEAD>\n";

print "<BODY>\n

print "<P>FlashConnect exception redirection!\n";

# Display the env vars if available

$env_file = @ARGV[0];

if ($env_file){

   print "<P>There are some environment variables for clues!\n";

   print "They're in $env_file, and the ones with values are:\n";

   open(FH,$env_file);

   while (<FH>){ # read the next line of the file

      chop; # remove the line terminator

      $_ =~ / /; # look for a space in the default variable

      if ($' ne ""){ # if text exists to the right of the space...

         print "<P>\n"; # start a new paragraph

         print $_; # print the line

      }

   }

   print "\n";

   close(FH);

   unlink $env_file; # delete the file so they do not accumulate

}

# Now the final html tags

print "</BODY>\n";

print "</HTML>\n";

See Also

Windows Server Administration

Web Server

Customizing Internet Information Server (IIS), Netscape and Apache Web Server Error Messages