Skip to content

Commit a080862

Browse files
Silthusclaude
andcommitted
docs: describe an older server's refusal without its error code
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent bf687be commit a080862

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎posthog/emails.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ class CodeEmailArgs(_RecipientArgs):
251251
An optional field passed as ``None`` counts as left out.
252252
253253
A PostHog version that doesn't take a field yet, such as ``cc``, refuses
254-
the send with ``invalid_request`` and names the field in
255-
``EmailError.field``. It never drops the field and sends the rest.
254+
the send with an error that names the field in ``EmailError.field``. It
255+
never drops the field and sends the rest.
256256
257257
Args:
258258
to: One recipient email address.

‎posthog/test/test_emails.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -849,9 +849,9 @@ def test_rejects_a_code_send_that_mixes_or_misses_fields(_name, overrides, error
849849

850850
def test_a_server_that_does_not_take_a_field_refuses_the_send_and_names_it():
851851
refused = {
852-
"type": "invalid_request",
853-
"code": "invalid_request",
854-
"detail": "cc: PostHog doesn't take this field on this route.",
852+
"type": "validation_error",
853+
"code": "invalid_input",
854+
"detail": "PostHog doesn't take this field, so it doesn't send the email without it.",
855855
"attr": "cc",
856856
}
857857
emails, adapter = emails_with([(400, refused, {}), accepted()])
@@ -862,7 +862,7 @@ def test_a_server_that_does_not_take_a_field_refuses_the_send_and_names_it():
862862
error = raised.value
863863
assert (error.name, error.code, error.field) == (
864864
"validation_error",
865-
"invalid_request",
865+
"invalid_input",
866866
"cc",
867867
)
868868
assert len(adapter.requests) == 1

0 commit comments

Comments
 (0)