mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-10-01 01:35:48 -04:00
remove global error handler for taking offer
This commit is contained in:
parent
fdb24ba9f8
commit
342c212ba8
@ -93,7 +93,6 @@ public class HavenoHeadlessApp implements HeadlessApp {
|
||||
lastVersion, Version.VERSION));
|
||||
havenoSetup.setTorAddressUpgradeHandler(() -> log.info("setTorAddressUpgradeHandler"));
|
||||
corruptedStorageFileHandler.getFiles().ifPresent(files -> log.warn("getCorruptedDatabaseFiles. files={}", files));
|
||||
tradeManager.setTakeOfferRequestErrorMessageHandler(errorMessage -> log.error("Error taking offer: " + errorMessage));
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
|
@ -86,7 +86,6 @@ import javafx.beans.property.SimpleLongProperty;
|
||||
import javafx.collections.ListChangeListener;
|
||||
import javafx.collections.ObservableList;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import monero.daemon.model.MoneroTx;
|
||||
import monero.wallet.model.MoneroOutputQuery;
|
||||
import org.bitcoinj.core.Coin;
|
||||
@ -149,9 +148,6 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
|
||||
private final TradableList<Trade> tradableList = new TradableList<>();
|
||||
@Getter
|
||||
private final BooleanProperty persistedTradesInitialized = new SimpleBooleanProperty();
|
||||
@Setter
|
||||
@Nullable
|
||||
private ErrorMessageHandler takeOfferRequestErrorMessageHandler;
|
||||
@Getter
|
||||
private final LongProperty numPendingTrades = new SimpleLongProperty();
|
||||
private final ReferralIdService referralIdService;
|
||||
@ -613,7 +609,6 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
|
||||
((ArbitratorProtocol) getTradeProtocol(trade)).handleInitTradeRequest(request, sender, errorMessage -> {
|
||||
log.warn("Arbitrator error during trade initialization for trade {}: {}", trade.getId(), errorMessage);
|
||||
maybeRemoveTradeOnError(trade);
|
||||
if (takeOfferRequestErrorMessageHandler != null) takeOfferRequestErrorMessageHandler.handleErrorMessage(errorMessage);
|
||||
});
|
||||
|
||||
requestPersistence();
|
||||
@ -702,7 +697,6 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
|
||||
((MakerProtocol) getTradeProtocol(trade)).handleInitTradeRequest(request, sender, errorMessage -> {
|
||||
log.warn("Maker error during trade initialization: " + errorMessage);
|
||||
maybeRemoveTradeOnError(trade);
|
||||
if (takeOfferRequestErrorMessageHandler != null) takeOfferRequestErrorMessageHandler.handleErrorMessage(errorMessage);
|
||||
});
|
||||
|
||||
requestPersistence();
|
||||
@ -893,7 +887,6 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
|
||||
xmrWalletService.resetAddressEntriesForOpenOffer(trade.getId());
|
||||
maybeRemoveTradeOnError(trade);
|
||||
errorMessageHandler.handleErrorMessage(errorMessage);
|
||||
if (takeOfferRequestErrorMessageHandler != null) takeOfferRequestErrorMessageHandler.handleErrorMessage(errorMessage);
|
||||
});
|
||||
requestPersistence();
|
||||
} else {
|
||||
@ -903,7 +896,6 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
|
||||
errorMessage -> {
|
||||
log.warn("Taker error during check offer availability: " + errorMessage);
|
||||
errorMessageHandler.handleErrorMessage(errorMessage);
|
||||
if (takeOfferRequestErrorMessageHandler != null) takeOfferRequestErrorMessageHandler.handleErrorMessage(errorMessage);
|
||||
});
|
||||
|
||||
requestPersistence();
|
||||
|
@ -418,10 +418,6 @@ public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener
|
||||
.useShutDownButton()
|
||||
.show());
|
||||
|
||||
tradeManager.setTakeOfferRequestErrorMessageHandler(errorMessage -> new Popup()
|
||||
.warning(Res.get("popup.error.takeOfferRequestFailed", errorMessage))
|
||||
.show());
|
||||
|
||||
havenoSetup.getXmrDaemonSyncProgress().addListener((observable, oldValue, newValue) -> updateXmrDaemonSyncProgress());
|
||||
havenoSetup.getXmrWalletSyncProgress().addListener((observable, oldValue, newValue) -> updateXmrWalletSyncProgress());
|
||||
|
||||
|
@ -226,8 +226,6 @@ class TakeOfferDataModel extends OfferDataModel {
|
||||
// UI actions
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// errorMessageHandler is used only in the check availability phase. As soon we have a trade we write the error msg in the trade object as we want to
|
||||
// have it persisted as well.
|
||||
void onTakeOffer(TradeResultHandler tradeResultHandler, ErrorMessageHandler errorMessageHandler) {
|
||||
checkNotNull(getTakerFee(), "takerFee must not be null");
|
||||
|
||||
|
@ -613,8 +613,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||
|
||||
errorMessageSubscription = EasyBind.subscribe(model.errorMessage, newValue -> {
|
||||
if (newValue != null) {
|
||||
new Popup().error(Res.get("takeOffer.error.message", model.errorMessage.get()) + "\n\n" +
|
||||
Res.get("popup.error.tryRestart"))
|
||||
new Popup().warning(Res.get("takeOffer.error.message", model.errorMessage.get()))
|
||||
.onClose(() -> {
|
||||
errorPopupDisplayed.set(true);
|
||||
model.resetErrorMessage();
|
||||
|
Loading…
Reference in New Issue
Block a user