summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/GuiErrorCallback.java
diff options
context:
space:
mode:
authorSimon Rettberg2015-10-01 20:00:27 +0200
committerSimon Rettberg2015-10-01 20:00:27 +0200
commit1fd45f1ec985012179b26c8136eadf0c5ae3c2c8 (patch)
tree05f2c0065d4e837f896cd3b0668125e87a211806 /dozentenmodul/src/main/java/org/openslx/dozmod/thrift/GuiErrorCallback.java
parent[client] Fix escape not working in message boxes (diff)
downloadtutor-module-1fd45f1ec985012179b26c8136eadf0c5ae3c2c8.tar.gz
tutor-module-1fd45f1ec985012179b26c8136eadf0c5ae3c2c8.tar.xz
tutor-module-1fd45f1ec985012179b26c8136eadf0c5ae3c2c8.zip
[client] Start upload only when finishing wizard, add final summary page to wizard
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/thrift/GuiErrorCallback.java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/thrift/GuiErrorCallback.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/GuiErrorCallback.java b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/GuiErrorCallback.java
index 11c3c3da..26e11504 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/GuiErrorCallback.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/GuiErrorCallback.java
@@ -25,23 +25,26 @@ public class GuiErrorCallback implements ErrorCallback {
@Override
public boolean thriftError(int failCount, final String method, final Throwable t) {
// if it's not a transport exception, do not retry
- if (!(t instanceof TTransportException))
+ if (t != null && !(t instanceof TTransportException))
return false;
- final TTransportException tex = (TTransportException) t;
// if it's the first fail, retry immediately
if (failCount == 1)
return true;
// Some methods are non-critical, so don't show a pop-up
if (ThriftError.failSilently(method))
- return false;
+ return failCount == 2; // As it's silent, give it a second try...
// Otherwise, ask user if we should retry
+ final TTransportException tex = (TTransportException) t;
return Gui.syncExec(new GuiCallable<Boolean>() {
@Override
public Boolean run() {
+ String errMsg = null;
+ if (tex != null) {
+ errMsg = " (Fehler " + tex.getType() + ")";
+ }
return Gui.showMessageBox(parent, "Die Kommunikation mit " + serverString + " ist"
- + " gestört. Der Aufruf der Funktion " + method + " ist fehlgeschlagen (Fehler "
- + tex.getType() + ").\n\n" + "Möchten Sie den Aufruf wiederholen?",
- MessageType.ERROR_RETRY, LOGGER, t);
+ + " gestört. Der Aufruf der Funktion " + method + " ist fehlgeschlagen" + errMsg
+ + ".\n\n" + "Möchten Sie den Aufruf wiederholen?", MessageType.ERROR_RETRY, LOGGER, t);
}
});
}