Uploaded image for project: 'ODF Toolkit'
  1. ODF Toolkit
  2. ODFTOOLKIT-312

PATCH: Better exception handling for OdfPackage (swallows IOExceptions on save())

    XMLWordPrintableJSON

Details

    Description

      Related thread: http://mail-archives.apache.org/mod_mbox/incubator-odf-dev/201203.mbox/%3C20120322183411.573B.60BA733C@jeremias-maerki.ch%3E

      Executive summary: OdfPackage does too much exception catching causing real problems not being detected by client programs (because the exceptions are only logged). Similar patterns were observed when reading an ODF package. The attached patch tries to introduce a better exception handling throughout the OdfPackage class. Instead of throwing Exception, methods now throw IOException and SAXException. The existing load-side fault tolerance is preserved but the client can now abort processing if a potentially bad ODF file is read because exceptions thrown in the ErrorHandlers are no longer swallowed.

      I hope you find the proposed changes useful. They are backed by unit tests.

      Attachments

        1. OdfPackageExceptionHandling.diff
          43 kB
          Jeremias Maerki

        Activity

          People

            svanteschubert Svante Schubert
            jeremias@apache.org Jeremias Maerki
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: