@@ -638,18 +638,22 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
638638
639639 //this message should help us understand the logs when debugging issues. it will help
640640 // understand that there are more and more exceptions.
641- //code below and in handleInvocationTargetException will log the exceptions but our Log class
641+ //code below and in ApiErrorHandler. handleInvocationTargetException will log the exceptions but our Log class
642642 // will not explode the logs, so we don't see all the exceptions in the log as they happen.
643643 //this message will explode the idea.log if user has digma trace logging on and no backend running,
644644 // which shouldn't happen, users should not have digma trace logging on all the time.
645- var realCause = ExceptionUtils .findRootCause (e );
646- exception = realCause ;
647- Log .log (LOGGER ::trace , "got exception in AnalyticsService {}" , realCause );
645+ var rootCause = ExceptionUtils .findRootCausePreferConnectionException (e );
646+ exception = rootCause ;
647+ Log .log (LOGGER ::trace , "got exception in AnalyticsService {}" , rootCause );
648648
649649
650+ //for these methods we rethrow the exception without effecting the connection status.
651+ //prefer connection exception as root cause because if the code checks isConnectionException it should be true,
652+ // if we put the real root-cause it may be an exception that is not considered connection exception, for example
653+ // ssl exception may wrap EOFException and EOFException alone is not considered connection exception.
650654 if (methodsThatShouldNotChangeConnectionStatus .contains (method .getName ())) {
651655 Log .warnWithException (LOGGER , e , "error in method {}" , method .getName ());
652- throw new AnalyticsServiceException (realCause );
656+ throw new AnalyticsServiceException (rootCause );
653657 }
654658
655659
0 commit comments