Commits

Juan Carlos Picado Herrera committed 5e6ef6b

Disabled throw exception to controllers (temp) Related with ENCUESTAME-602

Comments (0)

Files changed (3)

enme-business/src/main/java/org/encuestame/business/service/PollService.java

         if(emailList !=null){
                  for (Email emails : emailsList) {
                     if (EnMePlaceHolderConfigurer.getBooleanProperty("application.email.disabled")) {
-                            getMailService().send(emails.getEmail(),"New Poll", urlPoll);
+                            try {
+								getMailService().send(emails.getEmail(),"New Poll", urlPoll);
+							} catch (Exception e) {
+								// TODO Auto-generated catch block
+								e.printStackTrace();
+							}
                     }
                  }
          }

enme-core/src/main/java/org/encuestame/core/service/SecurityService.java

             userBean.setPassword(newPassword);
             //if notification is suspended we need retrieve password
             if (EnMePlaceHolderConfigurer.getBooleanProperty("application.email.enabled")) {
-                getMailService().sendRenewPasswordEmail(userBean);
+                try {
+                    getMailService().sendRenewPasswordEmail(userBean);
+                } catch (Exception e) {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
             //} else {
                 //log.warn("Notifications Email are suspendend");
             }
             singUpBean.setPassword(password);
             final String inviteCode =  UUID.randomUUID().toString();
             userAccount.setInviteCode(inviteCode);
-            getMailService().sendConfirmYourAccountEmail(singUpBean, inviteCode);
-            getMailService().sendPasswordConfirmationEmail(singUpBean);
+            try {
+                getMailService().sendConfirmYourAccountEmail(singUpBean, inviteCode);
+            } catch (Exception e1) {
+                // TODO Auto-generated catch block
+                e1.printStackTrace();
+            }
+            try {
+                getMailService().sendPasswordConfirmationEmail(singUpBean);
+            } catch (Exception e1) {
+                // TODO Auto-generated catch block
+                e1.printStackTrace();
+            }
             // save user
             getAccountDao().saveOrUpdate(userAccount);
             // assing first default group to user
             //send new password
             if (EnMePlaceHolderConfigurer.getBooleanProperty("application.email.enabled")) {
                 //send confirmation account request
-                getMailService().sendConfirmYourAccountEmail(singUpBean, inviteCode); //TODO: ENCUESTAME-202
+                try {
+                    getMailService().sendConfirmYourAccountEmail(singUpBean, inviteCode);
+                } catch (Exception e) {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
             }
         }
 
      */
     public void inviteUser(String email, String code) {
         if (EnMePlaceHolderConfigurer.getBooleanProperty("application.email.enabled")) {
-            getMailService().sendInvitation(email, code);
+            try {
+                getMailService().sendInvitation(email, code);
+            } catch (Exception e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
         }
     }
 
             final String password)
             throws MailSendException {
         if (EnMePlaceHolderConfigurer.getBooleanProperty("application.email.enabled")) {
-            getMailService().send(email, getMessageProperties("NewPassWordMail"), password);
+            try {
+                getMailService().send(email, getMessageProperties("NewPassWordMail"), password);
+            } catch (Exception e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
         }
     }
 
         }
         singUp = ConvertDomainBean.convertUserAccountToSignUpBean(userAcc);
         if (EnMePlaceHolderConfigurer.getBooleanProperty("application.email.enabled")) {
-            getMailService().welcomeNotificationAccount(userAcc);
+            try {
+                getMailService().welcomeNotificationAccount(userAcc);
+            } catch (Exception e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
         }
         return ConvertDomainBean.convertBasicSecondaryUserToUserBean(userAcc);
     }
                 final String inviteCode = UUID.randomUUID().toString();
                 userAccount.setInviteCode(inviteCode);
                 getAccountDao().saveOrUpdate(userAccount);
-                getMailService().sendConfirmYourAccountEmail(singUpBean, inviteCode);
+                try {
+                    getMailService().sendConfirmYourAccountEmail(singUpBean, inviteCode);
+                } catch (Exception e) {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
             } else {
                 log.warn("invite code requested by " + userAccount.getUsername() + " it's null");
             }
         singUp.setUsername(userAccBean.getUsername());
         getAccountDao().saveOrUpdate(singUp);
         if (EnMePlaceHolderConfigurer.getBooleanProperty("application.email.enabled")) {
-            getMailService().sendNotificationStatusAccount(singUp, "Change user status");
+            try {
+                getMailService().sendNotificationStatusAccount(singUp, "Change user status");
+            } catch (Exception e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
         }
     }
 

enme-core/src/main/java/org/encuestame/core/service/imp/MailServiceOperations.java

      *  @throws MailSendException exception
      */
     void send(final String to, final String subject, final String text)
-    throws MailSendException;
+    throws Exception;
 
     /**
      * Send a welcome notification after validate the account
      * @param user
      * @param message
      */
-    void welcomeNotificationAccount(final UserAccount user);
+    void welcomeNotificationAccount(final UserAccount user) throws Exception;
 
     /**
      * Send Password Confirmation Email.
      * @param user
      */
-    void sendPasswordConfirmationEmail(final SignUpBean user);
+    void sendPasswordConfirmationEmail(final SignUpBean user) throws Exception;
 
     /**
      * Send Renew Password Email.
      * @param unitUserBean {@link UserAccountBean}.
      */
-    void sendRenewPasswordEmail(final UserAccountBean unitUserBean);
+    void sendRenewPasswordEmail(final UserAccountBean unitUserBean) throws Exception;
 
     /**
      *
      * @param invitation
      */
-    void sendEmailInvitation(final InvitationBean invitation);
+    void sendEmailInvitation(final InvitationBean invitation) throws Exception;
 
     /**
      *
      * @param notification
      */
-    void sendEmailNotification(final NotificationBean notification);
+    void sendEmailNotification(final NotificationBean notification) throws Exception;
 
     /**
      * Send start up email notification.
      */
     void sendInvitation(
             final String to,
-            final String code) throws MailSendException;
+            final String code) throws Exception;
 
 
     /**
      * Sent email to confirm user account by email.
      * @param user
      */
-    void sendConfirmYourAccountEmail(final SignUpBean user, final String inviteCode);
+    void sendConfirmYourAccountEmail(final SignUpBean user, final String inviteCode) throws Exception;
 
     /**
      * Delete notification.
      * @param user
      * @param message
      */
-    void sendNotificationStatusAccount(final SignUpBean user, final String message);
+    void sendNotificationStatusAccount(final SignUpBean user, final String message) throws Exception;
 
     /**
      * Send Email Invitation.
      * @param invitation {@link InvitationBean}
      */
-    void sendEmailJoinInvitation(final String email, final String username);
+    void sendEmailJoinInvitation(final String email, final String username) throws Exception;
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.