Skip to content

Instantly share code, notes, and snippets.

@engr-erum
Created November 29, 2017 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save engr-erum/9d88f36b8acbddae96ca8305d6f0c364 to your computer and use it in GitHub Desktop.
Save engr-erum/9d88f36b8acbddae96ca8305d6f0c364 to your computer and use it in GitHub Desktop.
public static FailureResponse getErrorMessage(String responseString) {
Log.d(Utils.class.getName(),"responseString:"+responseString);
JsonParser parser = new JsonParser();
JsonElement mJson = null;
mJson = parser.parse(responseString);
Gson gson = new Gson();
FailureResponse failureResponse = gson.fromJson(mJson, FailureResponse.class);
return failureResponse;
}
public class FailureResponse {
private String[] non_errors;
public String[] getNon_errors() {
return non_errors;
}
public void setNon_errors(String[] non_errors) {
this.non_errors = non_errors;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment