Ticket #144 (closed defect: released)
Throw DatabaseFormatError instead of DatabaseOpeningError when database format is unsupported
| Reported by: | richard | Owned by: | richard |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.0 |
| Component: | Library API | Version: | SVN trunk |
| Severity: | normal | Keywords: | |
| Cc: | Blocked By: | ||
| Operating System: | All | Blocking: | #118 |
Description (last modified by richard) (diff)
This was suggested by Fabrice Colin on xapian-discuss: if an application writer wants to distinguish a failure to open a database because of a change in the database format from other failures to open the database (so that automatic upgrading of databases can be implemented, for example), they currently have to parse the error message. It would be much more helpful if there was a separate error type to catch.
Fabrice Colin suggested the name "DatabaseVersionError?", but I fear that this could be confused with the "DatabaseModifiedError?". Instead, I suggest the name "DatabaseFormatError?". It should be a subclass of "DatabaseOpeningError?" - both so that existing code which catches DatabaseOpeningError? will continue to work, and because it's an error to do with opening the database.
