Remove deprecated exception.
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 22 Oct 2020 09:11:15 +0000 (11:11 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 22 Oct 2020 09:11:15 +0000 (11:11 +0200)
org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/CmsLoginLifecycle.java

index 300c7566b4efcd9f348e2950f9f4160aad23d8bc..12ee3c55e9150fe17ea22a87bd85eb13e3dd9156 100644 (file)
@@ -10,7 +10,6 @@ import javax.security.auth.login.LoginException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.argeo.api.NodeConstants;
-import org.argeo.cms.CmsException;
 import org.argeo.cms.auth.CurrentUser;
 import org.argeo.cms.ui.CmsImageManager;
 import org.argeo.cms.ui.CmsView;
@@ -114,7 +113,7 @@ public class CmsLoginLifecycle implements CmsView {
        @Override
        public void authChange(LoginContext loginContext) {
                if (loginContext == null)
-                       throw new CmsException("Login context cannot be null");
+                       throw new IllegalArgumentException("Login context cannot be null");
                // logout previous login context
                // if (this.loginContext != null)
                // try {
@@ -128,12 +127,12 @@ public class CmsLoginLifecycle implements CmsView {
        @Override
        public void logout() {
                if (loginContext == null)
-                       throw new CmsException("Login context should not be null");
+                       throw new IllegalStateException("Login context should not be null");
                try {
                        CurrentUser.logoutCmsSession(loginContext.getSubject());
                        loginContext.logout();
                } catch (LoginException e) {
-                       throw new CmsException("Cannot log out", e);
+                       throw new IllegalStateException("Cannot log out", e);
                }
        }