Skip to content

Commit a917354

Browse files
committed
refactor(db): add detail for init db
1. print log detail when corruption error happens
1 parent 56eae01 commit a917354

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

chainbase/src/main/java/org/tron/common/storage/leveldb/LevelDbDataSourceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private void openDatabase(Options dbOptions) throws IOException {
140140
dbOptions.cacheSize() / 1024 / 1024, dbOptions.maxOpenFiles());
141141
} catch (IOException e) {
142142
if (e.getMessage().contains("Corruption:")) {
143-
logger.warn("DB {} corruption detected, try to repair it.", this.getDBName());
143+
logger.warn("DB {} corruption detected, try to repair it.", this.getDBName(), e);
144144
factory.repair(dbPath.toFile(), dbOptions);
145145
logger.warn("DB {} corruption detected, repair done.", this.getDBName());
146146
database = factory.open(dbPath.toFile(), dbOptions);

0 commit comments

Comments
 (0)