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/Utils.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/Utils.java')
-rw-r--r-- | src/com/gitblit/client/Utils.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/gitblit/client/Utils.java b/src/com/gitblit/client/Utils.java index ae81e7ff..786eb9f2 100644 --- a/src/com/gitblit/client/Utils.java +++ b/src/com/gitblit/client/Utils.java @@ -48,9 +48,16 @@ public class Utils { return table;
}
+ public static void explainNotAllowed(Component c, RpcRequest request) {
+ String msg = MessageFormat.format("The Gitblit server does not allow the request \"{0}\".",
+ request.name());
+ JOptionPane.showMessageDialog(c, msg, "Not Allowed", JOptionPane.ERROR_MESSAGE);
+ }
+
public static void explainForbidden(Component c, RpcRequest request) {
String msg = MessageFormat.format(
- "The request \"{0}\" has been forbidden by the Gitblit server.", request.name());
+ "The request \"{0}\" has been forbidden for the account by the Gitblit server.",
+ request.name());
JOptionPane.showMessageDialog(c, msg, "Forbidden", JOptionPane.ERROR_MESSAGE);
}
@@ -60,6 +67,12 @@ public class Utils { JOptionPane.showMessageDialog(c, msg, "Unauthorized", JOptionPane.ERROR_MESSAGE);
}
+ public static void explainUnknown(Component c, RpcRequest request) {
+ String msg = MessageFormat.format(
+ "The request \"{0}\" is not recognized by the Gitblit server.", request.name());
+ JOptionPane.showMessageDialog(c, msg, "Unknown Request", JOptionPane.ERROR_MESSAGE);
+ }
+
public static void showException(Component c, Throwable t) {
StringWriter writer = new StringWriter();
t.printStackTrace(new PrintWriter(writer));
|