Skip to content
Permalink
Browse files
FINCN-177 catch the most concrete exception
  • Loading branch information
Juhan Aasaru authored and Juhan Aasaru committed Oct 8, 2019
1 parent d95d246 commit 18db889e4c04447118014590f58b05c9bf3909d4
Showing 1 changed file with 3 additions and 3 deletions.
@@ -32,7 +32,7 @@
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.PessimisticLockingFailureException;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@@ -96,12 +96,12 @@ public synchronized void checkForBeatsNeeded() {
}
});

} catch (final DataAccessException e) {
} catch (final PessimisticLockingFailureException e) {
if (e.getMessage() != null && e.getMessage().contains("relation \"khepri_beats\" does not exist")) {
logger.info("Exception in check for scheduled beats as table khepri_beats does not exist. Probably cause initialize hasn't been called yet.");
}
else {
logger.warn("DataAccessException in check for scheduled beats", e);
logger.warn("PessimisticLockingFailureException in check for scheduled beats", e);
}
}
logger.info("checkForBeatsNeeded end.");

0 comments on commit 18db889

Please sign in to comment.