Skip to content

Commit aad66cb

Browse files
committed
requested changes
1 parent 7c96d2f commit aad66cb

4 files changed

Lines changed: 19 additions & 12 deletions

File tree

src/main/java/it/aboutbits/springboot/emailservice/lib/application/ManageEmail.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public EmailDto sendOrFail(@Valid EmailParameter parameter) throws EmailExceptio
7272
var savedEmail = send(email);
7373

7474
if (savedEmail.hasFailed()) {
75-
throw new EmailException(savedEmail.getErrorMessage());
75+
var errorMessage = savedEmail.getErrorMessage();
76+
throw new EmailException(errorMessage != null ? errorMessage : "");
7677
}
7778

7879
return emailMapper.toDto(savedEmail);

src/main/java/it/aboutbits/springboot/emailservice/lib/exception/AttachmentException.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
package it.aboutbits.springboot.emailservice.lib.exception;
22

3-
import org.jspecify.annotations.NullUnmarked;
3+
import org.jspecify.annotations.NullMarked;
44

5-
@NullUnmarked
5+
@NullMarked
66
public class AttachmentException extends Exception {
77
public AttachmentException() {
88
super();
99
}
1010

11-
public AttachmentException(final String message) {
11+
public AttachmentException(String message) {
1212
super(message);
1313
}
1414

15-
public AttachmentException(final String message, final Throwable cause) {
15+
public AttachmentException(String message, Throwable cause) {
1616
super(message, cause);
1717
}
1818

19-
public AttachmentException(final Throwable cause) {
19+
public AttachmentException(Throwable cause) {
2020
super(cause);
2121
}
2222

2323
protected AttachmentException(
24-
final String message,
25-
final Throwable cause,
26-
final boolean enableSuppression,
27-
final boolean writableStackTrace
24+
String message,
25+
Throwable cause,
26+
boolean enableSuppression,
27+
boolean writableStackTrace
2828
) {
2929
super(message, cause, enableSuppression, writableStackTrace);
3030
}

src/main/java/it/aboutbits/springboot/emailservice/lib/exception/EmailException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package it.aboutbits.springboot.emailservice.lib.exception;
22

3-
import org.jspecify.annotations.NullUnmarked;
3+
import org.jspecify.annotations.NullMarked;
44

5-
@NullUnmarked
5+
@NullMarked
66
public class EmailException extends Exception {
77
public EmailException() {
88
super();

src/main/java/it/aboutbits/springboot/emailservice/lib/model/Email.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.hibernate.annotations.UpdateTimestamp;
2323
import org.hibernate.type.SqlTypes;
2424
import org.jspecify.annotations.NullUnmarked;
25+
import org.jspecify.annotations.Nullable;
2526

2627
import java.time.OffsetDateTime;
2728
import java.util.List;
@@ -59,7 +60,9 @@ public class Email {
5960
private String fromAddress;
6061
private String fromName;
6162

63+
@Nullable
6264
private String replyToAddress;
65+
@Nullable
6366
private String replyToName;
6467

6568
@JdbcTypeCode(SqlTypes.JSON)
@@ -75,9 +78,12 @@ public class Email {
7578
private boolean attachmentsCleaned = false;
7679

7780
private OffsetDateTime scheduledAt;
81+
@Nullable
7882
private OffsetDateTime sentAt;
7983

84+
@Nullable
8085
private OffsetDateTime errorAt;
86+
@Nullable
8187
private String errorMessage;
8288

8389
@CreationTimestamp

0 commit comments

Comments
 (0)