Ticket #144: formaterror.patch
File formaterror.patch, 8.3 KB (added by , 18 years ago) |
---|
-
include/xapian/database.h
49 49 * 50 50 * @exception DatabaseOpeningError may be thrown if the database cannot 51 51 * be opened (for example, a required file cannot be found). 52 * 53 * @exception DatabaseFormatError may be thrown if the database is in an 54 * unsupported format (for example, created by a newer version of Xapian 55 * which uses an incompatible format). 52 56 */ 53 57 class XAPIAN_VISIBILITY_DEFAULT Database { 54 58 public: -
exception_data.pm
128 128 /** DatabaseOpeningError indicates failure to open a database. */ 129 129 DOC 130 130 131 errorclass('DatabaseFormatError', 'DatabaseOpeningError', <<'DOC'); 132 /** DatabaseFormatError indicates that a database is in an unknown format. 133 * 134 * From time to time, new versions of Xapian will require the database format 135 * to be changed, to allow new information to be stored or new optimisations 136 * to be performed. Backwards compatibility will sometimes be maintained, so 137 * that new versions of Xapian can open old databases, but in some cases 138 * Xapian will be unable to open a database because it is in too old (or new) 139 * a format. This can be resolved either be upgrading or downgrading the 140 * version of Xapian in use, or by rebuilding the database from scratch with 141 * the current version of Xapian. 142 */ 143 DOC 144 131 145 errorclass('DocNotFoundError', 'RuntimeError', <<'DOC'); 132 146 /** Indicates an attempt to access a document not present in the database. */ 133 147 DOC -
backends/quartz/quartz_metafile.cc
80 80 unsigned int version; 81 81 version = decode_version(data.substr(metafile_magic.length(), 4)); 82 82 if (version != metafile_version) { 83 throw Xapian::Database OpeningError("Unknown Quartz metafile version " +83 throw Xapian::DatabaseFormatError("Unknown Quartz metafile version " + 84 84 om_tostring(version) + " in " + 85 85 filename); 86 86 } -
backends/quartz/quartz_database.h
183 183 * @exception Xapian::DatabaseCorruptError is thrown if there is no 184 184 * consistent revision available. 185 185 * 186 * @exception Xapian::DatabaseOpeningError thrown if database can't be opened. 186 * @exception Xapian::DatabaseOpeningError thrown if database can't be 187 * opened. 187 188 * 189 * @exception Xapian::DatabaseFormatError thrown if database is in an 190 * unsupported format. This implies that the database was 191 * created by an older or newer version of Xapian. 192 * 188 193 * @param dbdir directory holding quartz tables 189 194 * 190 195 * @param block_size Block size, in bytes, to use when creating … … 282 287 public: 283 288 /** Create and open a writable quartz database. 284 289 * 285 * @exception Xapian::DatabaseOpeningError thrown if database can't be opened. 290 * @exception Xapian::DatabaseOpeningError thrown if database can't be 291 * opened. 286 292 * 293 * @exception Xapian::DatabaseFormatError thrown if database is in an 294 * unsupported format. This implies that the database was 295 * created by an older or newer version of Xapian. 296 * 287 297 * @param dir directory holding quartz tables 288 298 */ 289 299 QuartzWritableDatabase(const string &dir, int action, int block_size); -
backends/quartz/quartz_metafile.h
45 45 /** Open the meta-file. 46 46 * 47 47 * @except Xapian::DatabaseOpeningError if the meta-file was not 48 * opened successfully or is compatible with this version49 * 48 * opened successfully or is not compatible with this 49 * version of the library. 50 50 */ 51 51 void open(); 52 52 -
backends/quartz/quartz_database.cc
96 96 if (!dbexists) { 97 97 // Catch pre-0.6 Xapian databases and give a better error 98 98 if (file_exists(db_dir + "/attribute_DB")) 99 throw Xapian::Database OpeningError("Cannot open database at `" + db_dir + "' - it was created by a pre-0.6 version of Xapian");99 throw Xapian::DatabaseFormatError("Cannot open database at `" + db_dir + "' - it was created by a pre-0.6 version of Xapian"); 100 100 throw Xapian::DatabaseOpeningError("Cannot open database at `" + db_dir + "' - it does not exist"); 101 101 } 102 102 // Can still allow searches even if recovery is needed … … 107 107 if (action == Xapian::DB_OPEN) { 108 108 // Catch pre-0.6 Xapian databases and give a better error 109 109 if (file_exists(db_dir + "/attribute_DB")) 110 throw Xapian::Database OpeningError("Cannot open database at `" + db_dir + "' - it was created by a pre-0.6 version of Xapian");110 throw Xapian::DatabaseFormatError("Cannot open database at `" + db_dir + "' - it was created by a pre-0.6 version of Xapian"); 111 111 throw Xapian::DatabaseOpeningError("Cannot open database at `" + db_dir + "' - it does not exist"); 112 112 } 113 113 -
backends/flint/flint_database.h
176 176 * @exception Xapian::DatabaseCorruptError is thrown if there is no 177 177 * consistent revision available. 178 178 * 179 * @exception Xapian::DatabaseOpeningError thrown if database can't be opened. 179 * @exception Xapian::DatabaseOpeningError thrown if database can't 180 * be opened. 180 181 * 182 * @exception Xapian::DatabaseFormatError thrown if database is in an 183 * unsupported format. This implies that the database was 184 * created by an older or newer version of Xapian. 185 * 181 186 * @param dbdir directory holding flint tables 182 187 * 183 188 * @param block_size Block size, in bytes, to use when creating … … 275 280 public: 276 281 /** Create and open a writable flint database. 277 282 * 278 * @exception Xapian::DatabaseOpeningError thrown if database can't be opened. 283 * @exception Xapian::DatabaseOpeningError thrown if database can't 284 * be opened. 279 285 * 286 * @exception Xapian::DatabaseFormatError thrown if database is in an 287 * unsupported format. This implies that the database was 288 * created by an older or newer version of Xapian. 289 * 280 290 * @param dir directory holding flint tables 281 291 */ 282 292 FlintWritableDatabase(const string &dir, int action, int block_size); -
backends/flint/flint_version.cc
126 126 msg += " is version "; 127 127 msg += om_tostring(version); 128 128 msg += " but I only understand "STRINGIZE(FLINT_VERSION); 129 throw Xapian::Database OpeningError(msg);129 throw Xapian::DatabaseFormatError(msg); 130 130 } 131 131 } -
backends/flint/flint_database.cc
82 82 if (!dbexists) { 83 83 // Catch pre-0.6 Xapian databases and give a better error 84 84 if (file_exists(db_dir + "/attribute_DB")) 85 throw Xapian::Database OpeningError("Cannot open database at `" + db_dir + "' - it was created by a pre-0.6 version of Xapian");85 throw Xapian::DatabaseFormatError("Cannot open database at `" + db_dir + "' - it was created by a pre-0.6 version of Xapian"); 86 86 throw Xapian::DatabaseOpeningError("Cannot open database at `" + db_dir + "' - it does not exist"); 87 87 } 88 88 // Can still allow searches even if recovery is needed