Aspose.Editor implements recovery method which may help to recover document in the case of control failure. When unhandled exception is thrown by the editor and caught by the caller this exception can be passed to the Editor.Recover method. This method does the following:
- Generates error report. When report is generated control records number of internal properties, exception stack, environment, and optionally original and current document as it appears in the editor.
- Pops up dialog where user can see what data is stored in the report, whether to save this report and if recovery is required.
Report is regular zip archive. If user decides to save documents into the report then among other few entries there are original and current document in Wordprocessing ML format. These files can be extracted from the report, renamed to *.xml and re-opened in the editor or Microsoft Word.
- Undoes last change in the document and tries to correct internal structures of the editor,
- If succeeded document is re-opened and method returns positive number.
- If failed method returns 0.
- If specified exception was Null method returns negative value.
If method returns positive value then application shall continue, if returned is zero then application needs to either terminate, or re-create editor control.