Skip to content

Commit

Permalink
show more specific error when catching json exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Oct 10, 2015
1 parent da53e7d commit a8c141c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/client/Client.cpp
Expand Up @@ -729,7 +729,7 @@ RequestStatus Client::ParseServerReturn(char *result, int status, bool json)
lastError = httperror.str();
return RequestFailure;
}
lastError = "Could not read response";
lastError = std::string("Could not read response: ") + e.what();
return RequestFailure;
}
}
Expand Down Expand Up @@ -1439,7 +1439,7 @@ LoginStatus Client::Login(std::string username, std::string password, User & use
}
catch (json::Exception &e)
{
lastError = "Could not read response";
lastError = std::string("Could not read response: ") + e.what();
return LoginError;
}
}
Expand Down Expand Up @@ -1670,7 +1670,7 @@ SaveInfo * Client::GetSave(int saveID, int saveDate)
}
catch (json::Exception &e)
{
lastError = "Could not read response";
lastError = std::string("Could not read response: ") + e.what();
free(data);
return NULL;
}
Expand Down Expand Up @@ -1842,7 +1842,7 @@ std::vector<std::pair<std::string, int> > * Client::GetTags(int start, int count
}
catch (json::Exception &e)
{
lastError = "Could not read response";
lastError = std::string("Could not read response: ") + e.what();
}
}
else
Expand Down Expand Up @@ -1925,7 +1925,7 @@ std::vector<SaveInfo*> * Client::SearchSaves(int start, int count, std::string q
}
catch (json::Exception &e)
{
lastError = "Could not read response";
lastError = std::string("Could not read response: ") + e.what();
}
}
free(data);
Expand Down Expand Up @@ -1985,7 +1985,7 @@ std::list<std::string> * Client::RemoveTag(int saveID, std::string tag)
}
catch (json::Exception &e)
{
lastError = "Could not read response";
lastError = std::string("Could not read response: ") + e.what();
}
}
free(data);
Expand Down Expand Up @@ -2031,7 +2031,7 @@ std::list<std::string> * Client::AddTag(int saveID, std::string tag)
}
catch (json::Exception &e)
{
lastError = "Could not read response";
lastError = std::string("Could not read response: ") + e.what();
}
}
free(data);
Expand Down

0 comments on commit a8c141c

Please sign in to comment.