add logging for dispute's trade being null #1364

This commit is contained in:
woodser 2024-10-30 09:18:39 -04:00
parent 22f32f43a0
commit ed567beeb3
3 changed files with 3 additions and 1 deletions

View File

@ -958,6 +958,7 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
}
public void unregisterTrade(Trade trade) {
log.warn("Unregistering {} {}", trade.getClass().getSimpleName(), trade.getId());
removeTrade(trade, true);
removeFailedTrade(trade);
requestPersistence();

View File

@ -41,6 +41,7 @@ public class ProcessDepositResponse extends TradeTask {
// throw if error
DepositResponse message = (DepositResponse) processModel.getTradeMessage();
if (message.getErrorMessage() != null) {
log.warn("Unregistering trade {} {} because deposit response has error message={}", trade.getClass().getSimpleName(), trade.getShortId(), message.getErrorMessage());
trade.setStateIfValidTransitionTo(Trade.State.PUBLISH_DEPOSIT_TX_REQUEST_FAILED);
processModel.getTradeManager().unregisterTrade(trade);
throw new RuntimeException(message.getErrorMessage());

View File

@ -1415,7 +1415,7 @@ public abstract class DisputeView extends ActivatableView<VBox, Void> implements
private String getDisputeStateText(Dispute dispute) {
Trade trade = tradeManager.getTrade(dispute.getTradeId());
if (trade == null) {
log.warn("Dispute's trade is null for trade {}", dispute.getTradeId());
log.warn("Dispute's trade is null for trade {}, defaulting to dispute state text 'closed'", dispute.getTradeId());
return Res.get("support.closed");
}
if (dispute.isClosed()) return Res.get("support.closed");