We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6511661 commit 28179a4Copy full SHA for 28179a4
lib/sendgrid/marketing_campaigns/contacts/recipients.ex
@@ -42,9 +42,17 @@ defmodule SendGrid.Contacts.Recipients do
42
43
{:error, errors}
44
end
45
-
46
# Handles the result when it's valid.
47
defp handle_recipient_result(%{body: %{"persisted_recipients" => [recipient_id]}}) do
48
{:ok, recipient_id}
49
+
50
+ # Handles the result when there were no returned recipients (for example if it's an update which didn't change anything)
51
+ defp handle_recipient_result(%{body: %{"persisted_recipients" => []}}) do
52
+ {:error, ["No changes applied for recipient"]}
53
+ end
54
55
+ defp handle_recipient_result(_) do
56
+ {:error, ["Unexpected error"]}
57
58
0 commit comments