Created
July 11, 2019 22:06
-
-
Save davidmerrick/33e2329676d9ca6e5a801662ab6c7805 to your computer and use it in GitHub Desktop.
Get root cause of an exception with Throwables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.common.base.Throwables; | |
try { | |
// Try a thing | |
} catch (Exception e) { | |
Throwable rootCause = Throwables.getRootCause(e); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment