Log provenance of Task error on server, but pass only exception msg to clients

Adjusted create offer validation test
This commit is contained in:
ghubstan 2020-10-02 15:02:37 -03:00
parent 628c557a98
commit 631c3f4f12
No known key found for this signature in database
GPG key ID: E35592D6800A861E
2 changed files with 4 additions and 4 deletions

View file

@ -46,8 +46,8 @@ public class ValidateCreateOfferTest extends AbstractCreateOfferTest {
.setPaymentAccountId(paymentAccount.getId())
.setDirection("buy")
.setCurrencyCode("usd")
.setAmount(100000000000L) // 1.0 BTC
.setMinAmount(100000000000L) // 1.0 BTC
.setAmount(100000000000L)
.setMinAmount(100000000000L)
.setUseMarketBasedPrice(false)
.setMarketPriceMargin(0.00)
.setPrice("10000.0000")
@ -55,7 +55,7 @@ public class ValidateCreateOfferTest extends AbstractCreateOfferTest {
.build();
Throwable exception = assertThrows(StatusRuntimeException.class, () ->
aliceStubs.offersService.createOffer(req).getOffer());
assertEquals("UNKNOWN: An error occurred at task ValidateOffer: Amount is larger than 1.00 BTC",
assertEquals("UNKNOWN: Amount is larger than 1.00 BTC",
exception.getMessage());
}
}

View file

@ -65,7 +65,7 @@ public abstract class Task<T extends Model> {
protected void failed(Throwable t) {
log.error(errorMessage, t);
taskHandler.handleErrorMessage(errorMessage);
taskHandler.handleErrorMessage(t.getMessage());
}
protected void failed() {