A Simple C++ Framework for Automatic Error Recovery
05 December 1990
Error recovery can be one of the more tedious and error-prone capabilities to implement. At each exit point within the span of code that modifies a protected object, one must ensure that the object is left in either the initial state or the goal state, not some intermediate state. When the object represents data, such as a text file, one can modify a copy of the original data in a buffer and then write the buffer contents over the file if and when the modification is completed. Error recovery in this case is fairly simple: if the user rejects the changes or the editor crashes during the editing session, the original file is left intact.