From 51d4504ebfaa6325c209d6d491f2f82dfd544431 Mon Sep 17 00:00:00 2001 From: woodser Date: Fri, 26 Dec 2025 16:00:08 -0400 Subject: [PATCH] expose runtime exceptions over grpc api (#2088) --- core/src/main/java/haveno/core/api/CorePriceService.java | 8 -------- .../java/haveno/daemon/grpc/GrpcExceptionHandler.java | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/core/src/main/java/haveno/core/api/CorePriceService.java b/core/src/main/java/haveno/core/api/CorePriceService.java index d4ed3257cf..a984b0ff22 100644 --- a/core/src/main/java/haveno/core/api/CorePriceService.java +++ b/core/src/main/java/haveno/core/api/CorePriceService.java @@ -101,14 +101,6 @@ class CorePriceService { // Offer price can be null (if price feed unavailable), thus a null-tolerant comparator is used. Comparator offerPriceComparator = Comparator.comparing(Offer::getPrice, Comparator.nullsLast(Comparator.naturalOrder())); - // TODO: remove this!!! - // Trading xmr-traditional is considered as buying/selling XMR, but trading xmr-crypto is - // considered as buying/selling crypto. Because of this, when viewing a xmr-crypto pair, - // the buy column is actually the sell column and vice versa. To maintain the expected - // ordering, we have to reverse the price comparator. - //boolean isCrypto = CurrencyUtil.isCryptoCurrency(currencyCode); - //if (isCrypto) offerPriceComparator = offerPriceComparator.reversed(); - // Offer amounts are used for the secondary sort. They are sorted from high to low. Comparator offerAmountComparator = Comparator.comparing(Offer::getAmount).reversed(); diff --git a/daemon/src/main/java/haveno/daemon/grpc/GrpcExceptionHandler.java b/daemon/src/main/java/haveno/daemon/grpc/GrpcExceptionHandler.java index 2afb6da2d0..85cc93aaf6 100644 --- a/daemon/src/main/java/haveno/daemon/grpc/GrpcExceptionHandler.java +++ b/daemon/src/main/java/haveno/daemon/grpc/GrpcExceptionHandler.java @@ -36,7 +36,7 @@ import org.slf4j.Logger; class GrpcExceptionHandler { private final Predicate isExpectedException = (t) -> - t instanceof IllegalStateException || t instanceof IllegalArgumentException; + t instanceof IllegalStateException || t instanceof IllegalArgumentException || t instanceof RuntimeException; @Inject public GrpcExceptionHandler() {