From 4ea4fa5d8129f877987b003ae023ac4c57d38c9a Mon Sep 17 00:00:00 2001 From: KirillPamPam Date: Mon, 30 Oct 2023 14:33:13 +0400 Subject: [PATCH] Suppress auth errors (#329) --- .../kotlin/io/emeraldpay/dshackle/auth/AuthInterceptor.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/auth/AuthInterceptor.kt b/src/main/kotlin/io/emeraldpay/dshackle/auth/AuthInterceptor.kt index 758f0d216..fc17c0576 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/auth/AuthInterceptor.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/auth/AuthInterceptor.kt @@ -30,9 +30,8 @@ class AuthInterceptor( if (isOrdinaryMethod && (sessionId == null || !authContext.containsSession(sessionId))) { val cause = if (sessionId == null) "sessionId is not passed" else "Session $sessionId does not exist" - throw Status.UNAUTHENTICATED - .withDescription(cause) - .asException() + call.close(Status.UNAUTHENTICATED.withDescription(cause), Metadata()) + return object : ServerCall.Listener() {} } return next.startCall(call, headers)