Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
silvanotamburini committed Nov 27, 2024
1 parent 7a318ff commit 2c8492b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package it.gov.pagopa.payhub.activities.helper;

import it.gov.pagopa.payhub.activities.exception.SendMailException;

import java.io.InputStream;
import java.util.Properties;

Expand All @@ -14,7 +16,7 @@ public Properties getProperties() {
InputStream inputStream = EmailHelper.class.getClassLoader().getResourceAsStream("mail-templates.properties");
properties.load(inputStream);
} catch (Exception e) {
return null;
throw new SendMailException("Error in mail template configuration");
}
return properties;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import it.gov.pagopa.payhub.activities.utils.Constants;
import org.apache.commons.text.StringSubstitutor;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
Expand Down Expand Up @@ -63,8 +62,11 @@ public static MailParams getMailParams(MailParams mailParams) {
params.setSuccess(true);
return params;
}
catch (SendMailException sendMailException) {
throw sendMailException;
}
catch (Exception e) {
throw new SendMailException("Error in mail configuration");
throw new SendMailException("Error in mail parameters");
}
}
}

0 comments on commit 2c8492b

Please sign in to comment.