Skip to content

Commit edd2d36

Browse files
authored
Android: preserve JSONException cause in setJSONValueForKey (#34)
The catch block had the original JSONException in hand but built the CodePushUnknownException without it, discarding the cause and its stack trace entirely. Pass it through so CodePushUtils.log(Throwable) callers downstream actually see why the JSON write failed.
1 parent 409db41 commit edd2d36

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

android/app/src/main/java/com/microsoft/codepush/react/CodePushUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public static void setJSONValueForKey(JSONObject json, String key, Object value)
219219
try {
220220
json.put(key, value);
221221
} catch (JSONException e) {
222-
throw new CodePushUnknownException("Unable to set value " + value + " for key " + key + " to JSONObject");
222+
throw new CodePushUnknownException("Unable to set value " + value + " for key " + key + " to JSONObject", e);
223223
}
224224
}
225225

0 commit comments

Comments
 (0)