-
Identify existing error handling code. Review your code to find your existing error handling code. This code may be reused to write a centralized error handling subsystem.
-
Identify possible types of errors. Review your application design to identify possible errors that you don't already have error handling code for. This information will be used to write new error handling code.
-
Create a class for handling errors. Create a class or library for your centralized error handling code.
-
Move error handling code. Move your existing error handling code to the new centralized error handling class or library.
-
Add error handling code. Use information about errors and exceptions that may need to be handled to write functions to handle them.
-
Replace error handling code. Replace your existing error and exception handling code with calls to the new centralized error handling functions.
-
Use a global exception handler. Write a handler for exceptions that are not handled by any other code specifically. Use the global exception handler throughout all code to catch exceptions when no other exception handler catches them.
-
Use centralized error handling. When adding new functionality to the program, use the centralized error handling subsystem to handle errors and exceptions.