Separate Throw And Catch

Code that determines the policies of the program usually appears very high in the call chain. Usually close to the user interface. Code that can go wrong can appear anywhere in the program. Error handling is usually a high level policy.

Therefore:

Put the error handling code as high in the call chain as possible and write the rest of the methods to propagate exceptions safely and to throw anytime they cannot fill their contracts. Exception handling, throwing, and propagation will be decoupled from each other and the program will be easier to write and maintain.


CategoryException


EditText of this page (last edited March 29, 2011) or FindPage with title or text search