Skip to content

Commit 1008cc8

Browse files
committed
Handle sendEmail erorr propoerly
Signed-off-by: Daniel Liszka <daniel@chainloop.dev>
1 parent cf76bb3 commit 1008cc8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/controlplane/extensions/core/smtp/v1/extension.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ func (i *Integration) Register(_ context.Context, req *sdk.RegistrationRequest)
110110
- To: %s
111111
`
112112
body := fmt.Sprintf(tpl, i.Describe().ID, i.Describe().Version, host, port, user, from, to)
113-
sendEmail(host, port, user, password, from, to, "", subject, body)
113+
err = sendEmail(host, port, user, password, from, to, "", subject, body)
114+
if err != nil {
115+
return nil, fmt.Errorf("sending an email: %w", err)
116+
}
114117

115118
return response, nil
116119
}
@@ -187,7 +190,10 @@ func (i *Integration) Execute(_ context.Context, req *sdk.ExecutionRequest) erro
187190
This email has been delivered via integration %s version %s.
188191
`
189192
body := fmt.Sprintf(tpl, req.WorkflowID, jsonBytes, i.Describe().ID, i.Describe().Version)
190-
sendEmail(host, port, user, password, from, to, ac.Cc, subject, body)
193+
err = sendEmail(host, port, user, password, from, to, ac.Cc, subject, body)
194+
if err != nil {
195+
return fmt.Errorf("sending an email: %w", err)
196+
}
191197

192198
return nil
193199
}

0 commit comments

Comments
 (0)