diff options
author | James Moger <james.moger@gitblit.com> | 2011-10-26 17:12:50 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2011-10-26 17:12:50 -0400 |
commit | 8b76369fb44bfd863b27bcede453d676905f52e5 (patch) | |
tree | cf9c57774855af728b845e4108a0c5f5acbb64ad /src/com/gitblit/client/GitblitClient.java | |
parent | 284a7bd54e9cddb0eabcd77148ee64639010d2ee (diff) | |
download | gitblit-8b76369fb44bfd863b27bcede453d676905f52e5.tar.gz gitblit-8b76369fb44bfd863b27bcede453d676905f52e5.zip |
Properly catch Not Allowed (405) and Unknown Request (501) errors
Diffstat (limited to 'src/com/gitblit/client/GitblitClient.java')
-rw-r--r-- | src/com/gitblit/client/GitblitClient.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/gitblit/client/GitblitClient.java b/src/com/gitblit/client/GitblitClient.java index 761283eb..9f4dd3e6 100644 --- a/src/com/gitblit/client/GitblitClient.java +++ b/src/com/gitblit/client/GitblitClient.java @@ -23,7 +23,9 @@ import java.util.List; import java.util.Map;
import com.gitblit.GitBlitException.ForbiddenException;
+import com.gitblit.GitBlitException.NotAllowedException;
import com.gitblit.GitBlitException.UnauthorizedException;
+import com.gitblit.GitBlitException.UnknownRequestException;
import com.gitblit.Keys;
import com.gitblit.models.FederationModel;
import com.gitblit.models.RepositoryModel;
@@ -78,21 +80,25 @@ public class GitblitClient implements Serializable { try {
refreshUsers();
+ refreshSettings();
allowManagement = true;
} catch (UnauthorizedException e) {
} catch (ForbiddenException e) {
+ } catch (NotAllowedException e) {
+ } catch (UnknownRequestException e) {
} catch (IOException e) {
- System.err.println(e.getMessage());
+ e.printStackTrace();
}
try {
- refreshSettings();
refreshStatus();
allowAdministration = true;
} catch (UnauthorizedException e) {
} catch (ForbiddenException e) {
+ } catch (NotAllowedException e) {
+ } catch (UnknownRequestException e) {
} catch (IOException e) {
- System.err.println(e.getMessage());
+ e.printStackTrace();
}
}
@@ -141,7 +147,7 @@ public class GitblitClient implements Serializable { settings = RpcUtils.getSettings(url, account, password);
return settings;
}
-
+
public ServerStatus refreshStatus() throws IOException {
status = RpcUtils.getStatus(url, account, password);
return status;
|