@@ -221,20 +221,25 @@ class AuthManager : Disposable {
221221
222222 } catch (e: InvocationTargetException ) {
223223
224- Log .warnWithException(logger, e, " Exception in auth proxy {}" , ExceptionUtils .getNonEmptyMessage(e))
224+ val authenticationException = ExceptionUtils .find(e, AuthenticationException ::class .java)
225+ // log debug on AuthenticationException because it happens a lot, every time the token expires
226+ if (authenticationException == null ) {
227+ Log .warnWithException(logger, e, " Exception in auth proxy {}" , ExceptionUtils .getNonEmptyMessage(e))
228+ } else {
229+ Log .debugWithException(logger, e, " AuthenticationException in auth proxy {}" , ExceptionUtils .getNonEmptyMessage(e))
230+ }
225231
226232 if (isPaused.get()) {
227233 Log .log(logger::trace, " got Exception in auth proxy but proxy is paused, rethrowing" )
228234 throw e
229235 }
230236
231237 // check if this is an AuthenticationException, if not rethrow the exception
232- @Suppress(" UNUSED_VARIABLE" )
233- val authenticationException = ExceptionUtils .find(e, AuthenticationException ::class .java)
234- ? : throw e
235-
236- Log .log(logger::trace, " got AuthenticationException, calling onAuthenticationException" )
238+ if (authenticationException == null ) {
239+ throw e
240+ }
237241
242+ Log .log(logger::trace, " got AuthenticationException {}, calling onAuthenticationException" , ExceptionUtils .getNonEmptyMessage(e))
238243 // call onAuthenticationException to refresh or login
239244 onAuthenticationException()
240245
0 commit comments