• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

13. Testing and Debugging > 13.2. Trapping Errors

Trapping Errors

Error handling and error trapping are big parts of debugging. After all, a bug is a programming error that hasn’t been fixed or can’t be fixed. But not all errors are bugs. An error may simply reflect an operational condition, such as an attempt to divide by zero. The error is not in the programming logic, but in the data. An error message is a developer’s way of saying “This is a condition that we couldn’t prevent, but this is what happened and this is what you should do.” It is the responsibility of the developer to fix errors caused by bugs and to handle errors caused by bad data or adverse runtime conditions (such as a loss of the connection).

try/catch Blocks

The try/catch construct gives server-side service developers an easy way to trap errors where they occur. (See Section 6.5, which covers Server-Side ActionScript; Section 8.6; or the related ColdFusion tags, <cftry> and <cfcatch>, in Chapter 5.)


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint