Improve logging

This commit is contained in:
Manfred Karrer 2019-01-02 00:05:14 +01:00
parent 0dadc05233
commit 4c3a721535
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46

View File

@ -21,6 +21,8 @@ import bisq.core.dao.node.BsqNode;
import bisq.core.dao.node.explorer.ExportJsonFilesService;
import bisq.core.dao.node.full.network.FullNodeNetworkService;
import bisq.core.dao.node.parser.BlockParser;
import bisq.core.dao.node.parser.exceptions.BlockHashNotConnectingException;
import bisq.core.dao.node.parser.exceptions.BlockHeightNotConnectingException;
import bisq.core.dao.node.parser.exceptions.RequiredReorgFromSnapshotException;
import bisq.core.dao.state.DaoStateService;
import bisq.core.dao.state.DaoStateSnapshotService;
@ -239,6 +241,9 @@ public class FullNode extends BsqNode {
}
private void handleError(Throwable throwable) {
if (throwable instanceof BlockHashNotConnectingException || throwable instanceof BlockHeightNotConnectingException) {
log.warn(throwable.toString());
} else {
String errorMessage = "An error occurred: Error=" + throwable.toString();
log.error(errorMessage);
throwable.printStackTrace();
@ -267,4 +272,5 @@ public class FullNode extends BsqNode {
if (errorMessageHandler != null)
errorMessageHandler.accept(errorMessage);
}
}
}