Skip to content
Snippets Groups Projects
Commit c6939fee authored by Karl Mortensen's avatar Karl Mortensen
Browse files

notify on error

parent 8f813ec2
No related branches found
No related tags found
No related merge requests found
......@@ -5789,14 +5789,15 @@ void executeCommand(DbCommand command) throws SQLException {
} catch (SQLException ex) {
if (ex.getErrorCode() == SQLITE_BUSY_ERROR || ex.getErrorCode() == DATABASE_LOCKED_ERROR) {
try {
// We do not notify of error here, as this is not an
// error condition. It is likely a temporary busy or
// locked issue and we will retry.
Thread.sleep(SLEEP_LENGTH_IN_MILLISECONDS);
} catch (InterruptedException exp) {
Logger.getLogger(SleuthkitCase.class.getName()).log(Level.WARNING, "Enexpectedly unable to wait for database.", exp);
}
} else {
if (null != sleuthkitCaseErrorObservers) {
notifyError(ex);
}
notifyError(ex);
throw ex;
}
}
......@@ -5842,7 +5843,7 @@ static Connection createConnection(String host, int port, String dbName, String
@Override
void executeCommand(DbCommand command) throws SQLException {
for(int retries=0; retries < MAX_RETRIES; retries++) {
for (int retries = 0; retries < MAX_RETRIES; retries++) {
try {
command.execute();
break;
......@@ -5856,6 +5857,7 @@ void executeCommand(DbCommand command) throws SQLException {
// Swallow, should never happen nor log
}
} else {
notifyError(ex);
throw ex;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment