More informative file validation check message - Fixes
@@ -194,29 +194,31 @@ public class FilePageStore implements PageStore {
long signature = hdr.getLong();
+ String prefix = "Failed to verify, file=" + cfgFile.getAbsolutePath() + "\" ";
+
if (SIGNATURE != signature)
- throw new IOException("Failed to verify store file (invalid file signature)" +
+ throw new IOException(prefix + "(invalid file signature)" +
" [expectedSignature=" + U.hexLong(SIGNATURE) +
", actualSignature=" + U.hexLong(signature) + ']');
int ver = hdr.getInt();
if (version() != ver)
- throw new IOException("Failed to verify store file (invalid file version)" +
+ throw new IOException(prefix + "(invalid file version)" +
" [expectedVersion=" + version() +
", fileVersion=" + ver + "]");
byte type = hdr.get();
if (this.type != type)
- throw new IOException("Failed to verify store file (invalid file type)" +
+ throw new IOException(prefix + "(invalid file type)" +
" [expectedFileType=" + this.type +
", actualFileType=" + type + "]");
int pageSize = hdr.getInt();
if (dbCfg.getPageSize() != pageSize)
- throw new IOException("Failed to verify store file (invalid page size)" +
+ throw new IOException(prefix + "(invalid page size)" +
" [expectedPageSize=" + dbCfg.getPageSize() +
", filePageSize=" + pageSize + "]");
@@ -226,7 +228,7 @@ public class FilePageStore implements PageStore {
fileSize = pageSize + headerSize();
if ((fileSize - headerSize()) % pageSize != 0)
- throw new IOException("Failed to verify store file (invalid file size)" +
+ throw new IOException(prefix + "(invalid file size)" +
" [fileSize=" + U.hexLong(fileSize) +
", pageSize=" + U.hexLong(pageSize) + ']');
