Skip to content

Commit 0b0e451

Browse files
committed
Add log line that could help us in case of errors in the JSON parsing with queryJSON.
1 parent 83eb9d1 commit 0b0e451

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

WordPressUtils/src/main/java/org/wordpress/android/util/JSONUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public static <U> U queryJSON(JSONObject source, String query, U defaultObject)
4444
if (result.getClass().isAssignableFrom(defaultObject.getClass())) {
4545
return (U) result;
4646
} else {
47+
AppLog.w(T.UTILS, String.format("The returned object type %s is not assignable to the type %s. Using default!",
48+
result.getClass(),defaultObject.getClass()));
4749
return defaultObject;
4850
}
4951
} catch (java.lang.ClassCastException e) {

0 commit comments

Comments
 (0)