Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit 099f9a8

Browse files
committed
improved error message
1 parent 654e772 commit 099f9a8

File tree

1 file changed

+7
-0
lines changed
  • core/src/main/java/org/owasp/dependencycheck

1 file changed

+7
-0
lines changed

core/src/main/java/org/owasp/dependencycheck/Engine.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,13 @@ private void initializeAndUpdateDatabase(final List<Throwable> exceptions) throw
720720
+ "data instead. Results may not include recent vulnerabilities.");
721721
LOGGER.debug("Update Error", ex);
722722
} catch (DatabaseException ex) {
723+
final String msg;
724+
if (ex.getMessage().contains("Unable to connect") && ConnectionFactory.isH2Connection(settings)) {
725+
msg = "Unable to update connect to the database - if this error persists it may be "
726+
+ "due to a corrupt database. Consider running `purge` to delete the existing database";
727+
} else {
728+
msg = "Unable to connect to the database";
729+
}
723730
throw new ExceptionCollection("Unable to connect to the database", ex);
724731
}
725732
} else {

0 commit comments

Comments
 (0)