From a9543dddc6c39c6e004eaaf7398c1a45fe42f688 Mon Sep 17 00:00:00 2001
From: Purodha <bli00@hostsharing.net>
Date: Thu, 07 Mar 2013 13:59:24 +0100
Subject: [PATCH] Displaing of HsarwebInternalException error messages.

---
 hsarweb/src/de/hsadmin/web/HomeModule.java                   |    2 +-
 hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java |    4 ++--
 hsarweb/src/de/hsadmin/web/AbstractModule.java               |    2 +-
 hsarweb/src/de/hsadmin/web/MainApplication.java              |   10 +++++++++-
 4 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/hsarweb/src/de/hsadmin/web/AbstractModule.java b/hsarweb/src/de/hsadmin/web/AbstractModule.java
index 846fe83..9e69384 100644
--- a/hsarweb/src/de/hsadmin/web/AbstractModule.java
+++ b/hsarweb/src/de/hsadmin/web/AbstractModule.java
@@ -87,7 +87,7 @@
 									((InsertAble) thisModule).insertRow(map);
 									componentFactory.loadData();
 								} catch (HsarwebException e) {
-									application.showUserException(e);
+									application.showHsarWebException(e);
 								}
 							}
 						});
diff --git a/hsarweb/src/de/hsadmin/web/HomeModule.java b/hsarweb/src/de/hsadmin/web/HomeModule.java
index a109e4d..e8004b6 100644
--- a/hsarweb/src/de/hsadmin/web/HomeModule.java
+++ b/hsarweb/src/de/hsadmin/web/HomeModule.java
@@ -146,7 +146,7 @@
 							}
 							((UpdateAble) thisModule).updateRow(map);
 						} catch (HsarwebException e) {
-							application.showUserException(e);
+							application.showHsarWebException(e);
 						}
 					}
 				});
diff --git a/hsarweb/src/de/hsadmin/web/MainApplication.java b/hsarweb/src/de/hsadmin/web/MainApplication.java
index fc81e35..40b4864 100644
--- a/hsarweb/src/de/hsadmin/web/MainApplication.java
+++ b/hsarweb/src/de/hsadmin/web/MainApplication.java
@@ -198,8 +198,16 @@
 		}
 	}
 
+	public void showHsarWebException(Exception e) {
+		if (e instanceof HsarwebUserException) {
+			showUserException(e);
+		} else {
+			showSystemException(e);
+		}		
+	}
+
 	public void showUserException(Exception e) {
-		getMainWindow().showNotification("Anwendungs-Fehler", "<br/ >" + e.getMessage(), Notification.TYPE_ERROR_MESSAGE);			
+		getMainWindow().showNotification("Anwendungs-Fehler", "<br />" + e.getMessage(), Notification.TYPE_ERROR_MESSAGE);			
 	}
 
 	public void showSystemException(Exception e) {
diff --git a/hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java b/hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java
index 566dc6a..363e32f 100644
--- a/hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java
+++ b/hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java
@@ -235,7 +235,7 @@
 							((UpdateAble) module).updateRow(map);
 							loadData();
 						} catch (HsarwebException e) {
-							application.showUserException(e);
+							application.showHsarWebException(e);
 						}
 					}
 				});
@@ -294,7 +294,7 @@
 							((DeleteAble) module).deleteRow(map);
 							loadData();
 						} catch (HsarwebException e) {
-							application.showUserException(e);
+							application.showHsarWebException(e);
 						}
 					}
 				});

--
Gitblit v1.9.1