Understanding errors
287
Errors such as validation errors, for which the application cannot continue processing the request,
but can provide an error-specific response, can also be considered recoverable. For example, an
error that occurs when a user enters text where a number is required can be considered
recoverable, because the application can recognize the error and redisplay the data field with a
message providing information about the error’s cause and telling the user to reenter the data.
Some types of errors might be recoverable in some, but not all circumstances. For example, your
application can retry a request following a time-out error, but it must also be prepared for the case
where the request always times out.
Error causes fall in the broad categories listed in the following table:
Although these categories do not map completely to the way ColdFusion categorizes errors they
provide a useful way of thinking about errors and can help you in preventing and handling errors
in your code.
ColdFusion error types
Before you can effectively manage ColdFusion errors, you must understand how ColdFusion
classifies and handles them. ColdFusion categorizes errors as detailed in the following table:
Most ColdFusion errors are exceptions. The following sections describe them in detail.
Category
Description
Program errors
Can be in the code syntax or the program logic. The ColdFusion compiler
identifies and reports program syntax errors when it compiles CFML into Java
classes. Errors in your application logic are harder to locate. For information on
debugging tools and techniques, see
Chapter 18, “Debugging and
Troubleshooting Applications,” on page 389
.
Unlike ColdFusion syntax errors, SQL syntax errors are only caught at runtime.
Data errors
Are typically user data input errors. You use validation techniques to identify
errors in user input data and enable the user to correct the errors.
System errors
Can come from a variety of causes, including database system problems, time-
outs due to excessive demands on your server, out-of-memory errors in the
system, file errors, and disk errors.
Type
Description
Exception
An error that prevents normal processing from continuing. All ColdFusion
exceptions are, at their root, Java exceptions.
Missing template
An HTTP request for a ColdFusion page that cannot be found. Generated if a
browser requests a ColdFusion page that does not exist.
Missing template errors are different from missing include exceptions, which
result from
cfinclude
tags or custom tag calls that cannot find their targets.
Form field data
validation
User data that does not meet the server-side form field validation rules in a
form being submitted. You specify server-side form validation by using hidden
HTML form fields. All other types of server-side validation, such as the
cfparam
tag generate runtime exceptions. For more information on validating
form fields see
“Validating form field data types” on page 579
.
Содержание COLDFUSION MX 61-DEVELOPING COLDFUSION MX
Страница 1: ...Developing ColdFusion MX Applications...
Страница 22: ...22 Contents...
Страница 38: ......
Страница 52: ...52 Chapter 2 Elements of CFML...
Страница 162: ......
Страница 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Страница 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Страница 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Страница 266: ......
Страница 314: ...314 Chapter 14 Handling Errors...
Страница 344: ...344 Chapter 15 Using Persistent Data and Locking...
Страница 349: ...About user security 349...
Страница 357: ...Security scenarios 357...
Страница 370: ...370 Chapter 16 Securing Applications...
Страница 388: ...388 Chapter 17 Developing Globalized Applications...
Страница 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Страница 410: ......
Страница 426: ...426 Chapter 19 Introduction to Databases and SQL...
Страница 476: ...476 Chapter 22 Using Query of Queries...
Страница 534: ...534 Chapter 24 Building a Search Interface...
Страница 556: ...556 Chapter 25 Using Verity Search Expressions...
Страница 558: ......
Страница 582: ...582 Chapter 26 Retrieving and Formatting Data...
Страница 668: ......
Страница 734: ...734 Chapter 32 Using Web Services...
Страница 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Страница 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Страница 788: ......
Страница 806: ...806 Chapter 35 Sending and Receiving E Mail...