Skip to content

Commit

Permalink
Fixed bad message displaying. Related to #80
Browse files Browse the repository at this point in the history
  • Loading branch information
Xero-Hige committed Jul 11, 2016
1 parent 9d3692b commit 3116639
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/main/java/ar/uba/fi/drtinder/UserHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ static String getLoginToken(String email, String password, String location) {
return mToken;
} catch (HttpClientErrorException e) {
DrTinderLogger.writeLog(DrTinderLogger.NET_ERRO, "Client error: " + e.getMessage());
if (e.getStatusCode().value() == 401) {
mToken = FAILED_TOKEN;
return FAILED_TOKEN;
}
mToken = ERROR_TOKEN;
return mToken;
} catch (ResourceAccessException e) {
Expand All @@ -128,10 +132,6 @@ static String getLoginToken(String email, String password, String location) {
int statusCode = response.getStatusCode().value();

if (statusCode != 200) {
if (statusCode == 401) {
mToken = FAILED_TOKEN;
return FAILED_TOKEN;
}
String errorMessage = "Failed login post: "
+ response.getStatusCode().value()
+ " " + response.getStatusCode().getReasonPhrase();
Expand Down

0 comments on commit 3116639

Please # to comment.