Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve error reporting for invalid H2 database #6339

Merged
merged 1 commit into from
Dec 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ private void initialize() throws DatabaseException {
LOGGER.debug("Unable to connect to the database", ex);
throw new DatabaseException("Unable to connect to the database", ex);
}
} else if (isH2 && ex.getMessage().contains("file version or invalid file header")) {
LOGGER.error("Incompatible or corrupt database found. To resolve this issue please remove the existing database by running purge");
throw new DatabaseException("Incompatible or corrupt database found; run the purge command to resolve the issue");
} else {
LOGGER.debug("Unable to connect to the database", ex);
throw new DatabaseException("Unable to connect to the database", ex);
Expand Down