MemorizingTrustManager
MemorizingTrustManager copied to clipboard
Use Log.getStackTraceString in JULHandle example
the previously used implementation to print the stacktrace would only print the stacktrace of the resulting Exception/Throwable, but the really relevant stacktrace is the one from the causing Exception/Throwable. Androids android.util.Log.getStackTraceString() achieves this by
while (t != null) {
t = t.getCause();
}
I am not quite sure if it is useful to "dig deep" and to follow the chain to the last element, or if we might lose information that way.
If yes, I'd prefer a manual chainwalk to calling an android method, which might have side effects. getStackTraceString
in the master branch for example replaces the stack trace of an UnknownHostException with an empty string. I am not sure which Android releases are affected by this, and I'd rather have the code behave equally on all releases.