Commit 41ec711f authored by unstablebrainiac's avatar unstablebrainiac

Add log to debug JsonSyntaxException

parent 369c0524
package app.insti.api.model; package app.insti.api.model;
import android.util.Log;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import java.util.List; import java.util.List;
...@@ -75,7 +78,12 @@ public class User implements CardInterface { ...@@ -75,7 +78,12 @@ public class User implements CardInterface {
} }
public static User fromString(String json) { public static User fromString(String json) {
return new Gson().fromJson(json, User.class); try {
return new Gson().fromJson(json, User.class);
} catch (JsonSyntaxException e) {
Log.d("User", "fromString: " + json);
return null;
}
} }
@NonNull @NonNull
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment