diff --git a/application/src/main/java/bisq/application/ApplicationService.java b/application/src/main/java/bisq/application/ApplicationService.java index 7812159c5b..1e311f7801 100644 --- a/application/src/main/java/bisq/application/ApplicationService.java +++ b/application/src/main/java/bisq/application/ApplicationService.java @@ -130,7 +130,7 @@ public ApplicationService(String configFileName, String[] args) { try { typesafeConfig = ConfigFactory.parseFile(customConfigFile).withFallback(defaultTypesafeConfig); } catch (Exception e) { - System.err.println("Error when reading custom config file " + ExceptionUtil.getMessageOrToString(e)); + System.err.println("Error when reading custom config file " + ExceptionUtil.getRootCauseMessage(e)); throw new RuntimeException(e); } } else { diff --git a/apps/desktop/desktop-app/src/main/java/bisq/desktop_app/DesktopApplicationService.java b/apps/desktop/desktop-app/src/main/java/bisq/desktop_app/DesktopApplicationService.java index a782e09fd7..b309feab76 100644 --- a/apps/desktop/desktop-app/src/main/java/bisq/desktop_app/DesktopApplicationService.java +++ b/apps/desktop/desktop-app/src/main/java/bisq/desktop_app/DesktopApplicationService.java @@ -274,7 +274,7 @@ public CompletableFuture initialize() { } } else { log.error("Initializing applicationService failed", throwable); - startupErrorMessage.set(ExceptionUtil.getMessageOrToString(throwable)); + startupErrorMessage.set(ExceptionUtil.getRootCauseMessage(throwable)); } setState(State.FAILED); return false; @@ -309,7 +309,7 @@ public CompletableFuture shutdown() { .handle((result, throwable) -> { if (throwable != null) { log.error("Error at shutdown", throwable); - shutDownErrorMessage.set(ExceptionUtil.getMessageOrToString(throwable)); + shutDownErrorMessage.set(ExceptionUtil.getRootCauseMessage(throwable)); return false; } else if (!result) { shutDownErrorMessage.set("Shutdown failed with result=false"); diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/common/threading/UIThread.java b/apps/desktop/desktop/src/main/java/bisq/desktop/common/threading/UIThread.java index a79bed5de8..e61fc7c5d9 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/common/threading/UIThread.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/common/threading/UIThread.java @@ -29,7 +29,7 @@ public static void run(Runnable task) { Platform.runLater(task); } } catch (Exception e) { - log.error("Exception at UIThread.run: {}", ExceptionUtil.getMessageOrToString(e)); + log.error("Exception at UIThread.run: {}", ExceptionUtil.getRootCauseMessage(e)); throw e; } } diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/open_trades/trade_state/states/BuyerStateOnchain3b.java b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/open_trades/trade_state/states/BuyerStateOnchain3b.java index 0f3448f97d..54ed9c8c86 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/open_trades/trade_state/states/BuyerStateOnchain3b.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/open_trades/trade_state/states/BuyerStateOnchain3b.java @@ -192,7 +192,7 @@ private void requestTx() { model.getConfirmationInfo().set(Res.get("bisqEasy.tradeState.info.phase3b.txId.failed", explorerService.getSelectedProvider().get().getBaseUrl(), rootCause.getClass().getSimpleName(), - ExceptionUtil.getMessageOrToString(rootCause))); + ExceptionUtil.getRootCauseMessage(rootCause))); } }); }); diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/open_trades/trade_state/states/SellerStateOnchain3b.java b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/open_trades/trade_state/states/SellerStateOnchain3b.java index 1a88f5b88c..7d4a116cb3 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/open_trades/trade_state/states/SellerStateOnchain3b.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/open_trades/trade_state/states/SellerStateOnchain3b.java @@ -192,7 +192,7 @@ private void requestTx() { model.getConfirmationInfo().set(Res.get("bisqEasy.tradeState.info.phase3b.txId.failed", explorerService.getSelectedProvider().get().getBaseUrl(), rootCause.getClass().getSimpleName(), - ExceptionUtil.getMessageOrToString(rootCause))); + ExceptionUtil.getRootCauseMessage(rootCause))); } }); }); diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/take_offer/payment_method/TakeOfferPaymentController.java b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/take_offer/payment_method/TakeOfferPaymentController.java index 3b5837c7a2..b563a5b5ed 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/take_offer/payment_method/TakeOfferPaymentController.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/take_offer/payment_method/TakeOfferPaymentController.java @@ -102,7 +102,7 @@ public void onActivate() { .filter(spec -> spec.getPaymentMethod().getPaymentRail() == persisted).findAny() .ifPresent(spec -> model.getSelectedBitcoinPaymentMethodSpec().set(spec)); } catch (Exception e) { - log.warn("Could not create BitcoinPaymentRail from persisted name {}. {}", name, ExceptionUtil.getMessageOrToString(e)); + log.warn("Could not create BitcoinPaymentRail from persisted name {}. {}", name, ExceptionUtil.getRootCauseMessage(e)); } }); settingsService.getCookie().asString(CookieKey.TAKE_OFFER_SELECTED_FIAT_METHOD, getCookieSubKey()) @@ -113,7 +113,7 @@ public void onActivate() { .filter(spec -> spec.getPaymentMethod().getPaymentRail() == persisted).findAny() .ifPresent(spec -> model.getSelectedFiatPaymentMethodSpec().set(spec)); } catch (Exception e) { - log.warn("Could not create FiatPaymentRail from persisted name {}. {}", name, ExceptionUtil.getMessageOrToString(e)); + log.warn("Could not create FiatPaymentRail from persisted name {}. {}", name, ExceptionUtil.getRootCauseMessage(e)); } }); } diff --git a/network/network/src/main/java/bisq/network/http/ClearNetHttpClient.java b/network/network/src/main/java/bisq/network/http/ClearNetHttpClient.java index 2195bd7305..b49027c975 100644 --- a/network/network/src/main/java/bisq/network/http/ClearNetHttpClient.java +++ b/network/network/src/main/java/bisq/network/http/ClearNetHttpClient.java @@ -70,14 +70,14 @@ public CompletableFuture shutdown() { return false; } } catch (IOException e) { - log.error("Error at shutdown {}", ExceptionUtil.getMessageOrToString(e)); + log.error("Error at shutdown {}", ExceptionUtil.getRootCauseMessage(e)); return false; } }, ExecutorFactory.newSingleThreadExecutor("ClearNetHttpClient-shutdown")) .orTimeout(500, TimeUnit.MILLISECONDS) .whenComplete((result, throwable) -> { if (throwable != null) { - log.warn("Error at shutdown: {}", ExceptionUtil.getMessageOrToString(throwable)); + log.warn("Error at shutdown: {}", ExceptionUtil.getRootCauseMessage(throwable)); } }); connection = null; @@ -146,7 +146,7 @@ protected String doRequest(String param, HttpMethod httpMethod, Optional shutdown() { .orTimeout(10, SECONDS) .whenComplete((list, throwable) -> { if (throwable != null) { - log.warn("Exception at node shutdown {}", ExceptionUtil.getMessageOrToString(throwable)); + log.warn("Exception at node shutdown {}", ExceptionUtil.getRootCauseMessage(throwable)); } outboundConnectionsByAddress.clear(); inboundConnectionsByAddress.clear(); @@ -746,7 +746,7 @@ private void handleException(Throwable exception) { } String msg = "Exception:"; if (exception instanceof EOFException) { - log.info("Exception: {}", ExceptionUtil.getMessageOrToString(exception)); + log.info("Exception: {}", ExceptionUtil.getRootCauseMessage(exception)); } else if (exception instanceof ConnectException) { log.debug(msg, exception); } else if (exception instanceof SocketException) { @@ -754,7 +754,7 @@ private void handleException(Throwable exception) { } else if (exception instanceof UnknownHostException) { log.warn("UnknownHostException. Might happen if we try to connect to wrong network type.", exception); } else if (exception instanceof SocketTimeoutException) { - log.info("Exception: {}", ExceptionUtil.getMessageOrToString(exception)); + log.info("Exception: {}", ExceptionUtil.getRootCauseMessage(exception)); } else if (exception instanceof ConnectionException) { ConnectionException connectionException = (ConnectionException) exception; if (connectionException.getCause() instanceof SocketTimeoutException) { @@ -770,7 +770,7 @@ private void handleException(Throwable exception) { log.warn(msg, exception); break; case PROTOBUF_IS_NULL: - log.info("Exception: {}", ExceptionUtil.getMessageOrToString(exception)); + log.info("Exception: {}", ExceptionUtil.getRootCauseMessage(exception)); break; case AUTHORIZATION_FAILED: log.warn(msg, exception); diff --git a/network/network/src/main/java/bisq/network/p2p/services/data/inventory/InventoryRequestService.java b/network/network/src/main/java/bisq/network/p2p/services/data/inventory/InventoryRequestService.java index ee1bb0761a..aaf5236a56 100644 --- a/network/network/src/main/java/bisq/network/p2p/services/data/inventory/InventoryRequestService.java +++ b/network/network/src/main/java/bisq/network/p2p/services/data/inventory/InventoryRequestService.java @@ -110,7 +110,7 @@ private void requestInventoryFromFreshConnection(Connection connection) { .whenComplete((inventory, throwable) -> { if (throwable != null) { log.error("Exception at inventory request to peer {}: {}", - connection.getPeerAddress().getFullAddress(), ExceptionUtil.getMessageOrToString(throwable)); + connection.getPeerAddress().getFullAddress(), ExceptionUtil.getRootCauseMessage(throwable)); } else { if (!allDataReceived.get()) { if (inventory.allDataReceived()) { @@ -196,7 +196,7 @@ private void startPeriodicRequests(long interval) { .whenComplete((inventory, throwable) -> { if (throwable != null) { log.info("Exception at periodic inventory request to peer {}: {}", - connection.getPeerAddress().getFullAddress(), ExceptionUtil.getMessageOrToString(throwable)); + connection.getPeerAddress().getFullAddress(), ExceptionUtil.getRootCauseMessage(throwable)); } else if (inventory.allDataReceived()) { allDataReceived.set(true); } diff --git a/network/network/src/main/java/bisq/network/p2p/services/data/inventory/InventoryResponseService.java b/network/network/src/main/java/bisq/network/p2p/services/data/inventory/InventoryResponseService.java index 4f4f292a24..af9174d8a6 100644 --- a/network/network/src/main/java/bisq/network/p2p/services/data/inventory/InventoryResponseService.java +++ b/network/network/src/main/java/bisq/network/p2p/services/data/inventory/InventoryResponseService.java @@ -100,7 +100,7 @@ private void handleInventoryRequest(InventoryRequest request, Connection connect System.currentTimeMillis() - ts); } catch (Exception e) { log.warn("Error at sending InventoryResponse to {}. {}", connection.getPeerAddress(), - ExceptionUtil.getMessageOrToString(e)); + ExceptionUtil.getRootCauseMessage(e)); } }); } else {