mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-22 22:45:21 +01:00
Log 'trade not found' a warning instead of full stack trace
This commit is contained in:
parent
e5a0a3998d
commit
320e63c0a1
2 changed files with 7 additions and 3 deletions
|
@ -58,9 +58,9 @@ class GrpcExceptionHandler {
|
|||
}
|
||||
|
||||
public void handleExceptionAsWarning(Logger log,
|
||||
String calledMethod,
|
||||
Throwable t,
|
||||
StreamObserver<?> responseObserver) {
|
||||
String calledMethod,
|
||||
Throwable t,
|
||||
StreamObserver<?> responseObserver) {
|
||||
// Just log a warning instead of an error with full stack trace.
|
||||
log.warn(calledMethod + " -> " + t.getMessage());
|
||||
var grpcStatusRuntimeException = wrapException(t);
|
||||
|
|
|
@ -78,6 +78,10 @@ class GrpcTradesService extends TradesGrpc.TradesImplBase {
|
|||
.build();
|
||||
responseObserver.onNext(reply);
|
||||
responseObserver.onCompleted();
|
||||
} catch (IllegalArgumentException cause) {
|
||||
// Offer makers may call 'gettrade' many times before a trade exists.
|
||||
// Log a 'trade not found' warning instead of a full stack trace.
|
||||
exceptionHandler.handleExceptionAsWarning(log, "getTrade", cause, responseObserver);
|
||||
} catch (Throwable cause) {
|
||||
exceptionHandler.handleException(log, cause, responseObserver);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue