Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Check server response code on version check.
Browse files Browse the repository at this point in the history
Refactored code.
  • Loading branch information
Carlos Munoz committed May 8, 2012
1 parent 1ac52f8 commit 6ab3657
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -56,15 +56,15 @@ public ZanataProxyFactory(URI base, String username, String apiKey, ClientExecut
IVersionResource iversion = createIVersionResource();
ClientResponse<VersionInfo> versionResp = iversion.get();
VersionInfo serverVersionInfo = null;
if( versionResp.getResponseStatus() == Response.Status.OK )
{
serverVersionInfo = versionResp.getEntity();
}
// unauthorized
else if( versionResp.getResponseStatus() == Response.Status.UNAUTHORIZED )
if( versionResp.getResponseStatus() == Response.Status.UNAUTHORIZED )
{
throw new RuntimeException("Incorrect username/password");
}
else
{
serverVersionInfo = versionResp.getEntity();
}
String serverVer = serverVersionInfo.getVersionNo();
String serverTimestamp = serverVersionInfo.getBuildTimeStamp();

Expand Down

0 comments on commit 6ab3657

Please sign in to comment.