Customizing the error message details
In the recipe Using a custom error handler to customize how exceptions are reported to the ViewController in this chapter, we've seen how to create a custom DCErrorHandlerImpl
class and override its reportException()
method in order to provide custom handling of the application's exceptions. In this recipe, we will go over the process of overriding the DCErrorHandlerImpl
class getDisplayMessage()
method, so that we can provide custom handling of specific application error messages. In particular, we will see how to reformat error messages generated by exceptions thrown from the database business logic code, using functionality provided by the ADF resource bundles. More specifically, we will assume that our application's database business logic source code throws exceptions using a user-defined database error number, with the actual resource error number and parameters bundled within the exception message. An example of the error message thrown by the...