Inside Coldfusion MX
Of course, we all like to think that we're really good developers. In a lot of cases, that's probably true. Still, like it or not, there are going to be times when the code that you write will not perform the way you expected. In those instances, it's important to make sure that you've provided a way for your application to gracefully handle those errors. If you were to attempt to perform a function within your application and that attempt was met with failure, you'd probably be able to easily decipher from the standard error message exactly what had caused the failure to occur. These standard error messages, while not particularly beautiful from a user interface (UI) standpoint, do provide a large amount of critical debugging information. Still, the end users of your application will likely have no need for this type of information, and they will probably feel much more comfortable when presented with an application error if it is wrapped in a neat little package. This is where error handling in ColdFusion MX comes in. In this chapter, we discuss common circumstances that can cause problems within your applications and ways that you can avoid these pitfalls. For the instances in which errors that you couldn't, or didn't, anticipate are generated, we examine some ways that you can handle the errors to prevent application instability. We do this in a way that ensures that your end users feel as if everything is under control with your application, even when errors are occurring. Finally, we examine some tips and tricks that enable you to hide the critical "standard" error messages from your users while still being able to look at them yourself when trying to diagnose your server problems. |