Like input validation, error handling is a very important aspect of a web application, but it is hard to do right. Without proper error handling, uncaught exceptions in the application (e.g., a
RuntimeException or a transaction-related exception) would propagate out of the web framework and cause a generic “Internal Server Error” (HTTP error code 500). The user would see a page full of technical jargon and a partial stack trace of the exception itself (see Figure 17.1). That is certainly unprofessional. Instead, we should try to fail gracefully and display a nice custom error page for the user.
Figure 17.1. An uncaught exception from the Seam event handler method
With the tight integration between business ...