Skip to content

Commit

Permalink
improved error message
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylong committed May 21, 2018
1 parent 654e772 commit 099f9a8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/main/java/org/owasp/dependencycheck/Engine.java
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,13 @@ private void initializeAndUpdateDatabase(final List<Throwable> exceptions) throw
+ "data instead. Results may not include recent vulnerabilities.");
LOGGER.debug("Update Error", ex);
} catch (DatabaseException ex) {
final String msg;
if (ex.getMessage().contains("Unable to connect") && ConnectionFactory.isH2Connection(settings)) {
msg = "Unable to update connect to the database - if this error persists it may be "
+ "due to a corrupt database. Consider running `purge` to delete the existing database";
} else {
msg = "Unable to connect to the database";
}
throw new ExceptionCollection("Unable to connect to the database", ex);
}
} else {
Expand Down

0 comments on commit 099f9a8

Please sign in to comment.