summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2015-08-18 18:08:49 +0200
committerJonathan Bauer2015-08-18 18:08:49 +0200
commitb400a141116cc1996945ef1e88a3259934d6c8ab (patch)
tree74ca0dd6405fb3f8a396a5bb05e1744449e63825
parent[client] critical bugfix (diff)
downloadtutor-module-b400a141116cc1996945ef1e88a3259934d6c8ab.tar.gz
tutor-module-b400a141116cc1996945ef1e88a3259934d6c8ab.tar.xz
tutor-module-b400a141116cc1996945ef1e88a3259934d6c8ab.zip
[client] minor error handling improvement when deleting an image version
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java
index edb430de..8d196ac1 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java
@@ -392,6 +392,7 @@ public class ImageListWindow extends ImageListWindowLayout implements DownloadCa
// try to actually delete this version of the image
QuickTimer.scheduleOnce(new Task() {
boolean success = false;
+ Exception error = null;
@Override
public void fire() {
try {
@@ -400,19 +401,13 @@ public class ImageListWindow extends ImageListWindowLayout implements DownloadCa
LOGGER.info("Deleted version '" + image.getLatestVersionId() + "' of image '"
+ image.getImageBaseId() + "'.");
success = true;
- } catch (TAuthorizationException e) {
- Gui.showMessageBox(me, "Sie sind nicht autorisiert dieses Image zu löschen!",
- MessageType.ERROR, LOGGER, e);
- } catch (TNotFoundException e) {
- Gui.showMessageBox(me, "Diese Image existiert nicht auf dem Satelliten!",
- MessageType.ERROR, LOGGER, e);
- } catch (TException e) {
- Gui.showMessageBox(me, "Interner Fehler! Siehe Logs.", MessageType.ERROR, LOGGER, e);
+ } catch (Exception e) {
+ error = e;
}
Gui.asyncExec(new Runnable() {
@Override
public void run() {
- deletedLatestVersion(success);
+ deletedLatestVersion(success, error);
}
});
}
@@ -423,7 +418,10 @@ public class ImageListWindow extends ImageListWindowLayout implements DownloadCa
*
* @param success true if the latest image version was deleted, false otherwise
*/
- public void deletedLatestVersion(boolean success) {
+ public void deletedLatestVersion(boolean success, Exception e) {
+ if (e != null) {
+ Gui.showMessageBox(me, "Fehler", MessageType.ERROR, LOGGER, e);
+ }
refreshList(success);
}