You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2014/11/07 09:35:28 UTC

[2/3] syncope git commit: [SYNCOPE-603] Now raising an exception checked by console's exception reporting

[SYNCOPE-603] Now raising an exception checked by console's exception reporting


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/972f5dba
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/972f5dba
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/972f5dba

Branch: refs/heads/master
Commit: 972f5dba12c00012cd1fb23b0f3900c2a742cee5
Parents: ebfe1fb
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Fri Nov 7 09:35:03 2014 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Fri Nov 7 09:35:03 2014 +0100

----------------------------------------------------------------------
 .../apache/syncope/console/SyncopeApplication.java    | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/972f5dba/console/src/main/java/org/apache/syncope/console/SyncopeApplication.java
----------------------------------------------------------------------
diff --git a/console/src/main/java/org/apache/syncope/console/SyncopeApplication.java b/console/src/main/java/org/apache/syncope/console/SyncopeApplication.java
index c06831b..9aba5f7 100644
--- a/console/src/main/java/org/apache/syncope/console/SyncopeApplication.java
+++ b/console/src/main/java/org/apache/syncope/console/SyncopeApplication.java
@@ -43,6 +43,7 @@ import org.apache.wicket.Component;
 import org.apache.wicket.Page;
 import org.apache.wicket.RestartResponseAtInterceptPageException;
 import org.apache.wicket.Session;
+import org.apache.wicket.WicketRuntimeException;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.markup.html.AjaxLink;
 import org.apache.wicket.authorization.IUnauthorizedComponentInstantiationListener;
@@ -242,9 +243,16 @@ public class SyncopeApplication
 
             @Override
             public void onClick(final AjaxRequestTarget target) {
-                final UserTO userTO = SyncopeSession.get().isAuthenticated()
-                        ? userSelfRestClient.read()
-                        : new UserTO();
+                final UserTO userTO;
+                if (SyncopeSession.get().isAuthenticated()) {
+                    try {
+                        userTO = userSelfRestClient.read();
+                    } catch (Exception e) {
+                        throw new WicketRuntimeException(e);
+                    }
+                } else {
+                    userTO = new UserTO();
+                }
 
                 editProfileModalWin.setPageCreator(new ModalWindow.PageCreator() {