Bugfix: using statusElement and not codeElement again

This commit is contained in:
Marc Egea i Sala 2015-10-02 15:22:55 +01:00
parent 3970fb146c
commit 6ae47e8821

View file

@ -203,13 +203,13 @@ public class Util {
serr(json.toString());
serr("End of response");
JsonElement statusElement = json.get("status");
if (codeElement == null) {
code = statusElement.getAsString();
if (code.equals("422")) {
if (statusElement != null) {
String status = statusElement.getAsString();
if (status.equals("422")) {
error = "Unprocessable entity";
} else if (code.equals("404")) {
} else if (status.equals("404")) {
error = "Not found";
} else if (code.equals("403")) {
} else if (status.equals("403")) {
error = "Forbidden";
}
}