From f2f64f25ebd1888d7b79dcef0b31f48fad70a2ee Mon Sep 17 00:00:00 2001 From: Mygod Date: Thu, 9 Jul 2020 16:41:33 -0400 Subject: [PATCH] Include original exception as cause when throwing RuntimeException --- .../src/main/java/eu/chainfire/librootjava/Reflection.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/librootjava/src/main/java/eu/chainfire/librootjava/Reflection.java b/librootjava/src/main/java/eu/chainfire/librootjava/Reflection.java index 077d35b..560ab7a 100644 --- a/librootjava/src/main/java/eu/chainfire/librootjava/Reflection.java +++ b/librootjava/src/main/java/eu/chainfire/librootjava/Reflection.java @@ -59,7 +59,7 @@ static Context getSystemContext() { return systemContext; } catch (Exception e) { Logger.ex(e); - throw new RuntimeException("librootjava: unexpected exception in getSystemContext()"); + throw new RuntimeException("librootjava: unexpected exception in getSystemContext()", e); } } } @@ -102,9 +102,8 @@ private static Object getActivityManager() { return oActivityManager; } catch (Exception e) { Logger.ex(e); + throw new RuntimeException("librootjava: unable to retrieve ActivityManager", e); } - - throw new RuntimeException("librootjava: unable to retrieve ActivityManager"); } }