MemorizingTrustManager icon indicating copy to clipboard operation
MemorizingTrustManager copied to clipboard

Use Log.getStackTraceString in JULHandle example

Open Flowdalic opened this issue 10 years ago • 1 comments

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();
}

Flowdalic avatar Nov 22 '14 11:11 Flowdalic

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. getStackTraceStringin 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.

ge0rg avatar Dec 03 '14 17:12 ge0rg