Method and system for verifying and storing documents during a failure in
a program module. Once a failure is detected in the program module,
control passes to an exception handler that determines whether the open
files have been modified. If so, a crash handler is executed, which
verifies and stores the documents by detecting and repairing any
discovered corruption. The program module is then terminated and
restarted. Upon restarting the program module, the repaired document is
opened and displayed to the user with a list of repairs.