
200
Chapter 11 Preventing and Handling Errors
Creating an error application page
Error application pages for validation and request errors cannot use ColdFusion
tags; they can only use HTML tags. Error application pages for exception and
monitor errors can use all of CFML, including tags, expressions, and functions.
Even validation and request error pages have access to specific CFML error variables
such as Error.Diagnostics (for request errors) and Error.InvalidFields (for validation
errors). All CFML error variables start with the prefix Error. To include these variables
in your HTML, surround the variable names with pound signs, but do not use the
cfoutput
tag; for example:
<p>
ColdFusion found the following errors in the data you entered:
</p>
#error.InvalidFields#<br>
Error page variables
The following variables are available on error pages:
Error type
Error variable
Description
Exception
Request
Monitor
error.type
The exception type. For a list of error
types, see “Types of recoverable
exceptions supported” on page 205.
error.diagnostics
Detailed error diagnostics from
ColdFusion Server.
error.mailTo
E-mail address of administrator who
should be notified (corresponds to the
value set in the
mailTo
attribute of
cferror
).
error.dateTime
Date and time when the error
occurred.
error.browser
Browser that was running when the
error occurred.
error.generatedContent
The failed request’s generated
content.
error.remoteAddress
IP address of the remote client.
error.HTTPReferer
Page from which the client accessed
the link to the page where the error
occurred.
error.template
Page being executed when the error
occurred.
error.queryString
URL query string of the client's
request.
Содержание COLDFUSION 5-DEVELOPING
Страница 1: ...Macromedia Incorporated Developing ColdFusion Applications MacroMedia ColdFusion 5 ...
Страница 58: ...38 Chapter 3 Querying a Database ...
Страница 134: ...114 Chapter 7 Updating Your Database ...
Страница 210: ...190 Chapter 10 Reusing Code ...
Страница 232: ...212 Chapter 11 Preventing and Handling Errors ...
Страница 238: ...218 Chapter 12 Using the Application Framework ...
Страница 262: ...242 Chapter 12 Using the Application Framework ...
Страница 278: ...258 Chapter 13 Extending ColdFusion Pages with CFML Scripting ...
Страница 320: ...300 Chapter 15 Indexing and Searching Data ...
Страница 336: ...316 Chapter 16 Sending and Receiving E mail ...
Страница 374: ...354 Chapter 18 Interacting with Remote Servers ...