🐛(dimail) enhance sentry log for dimail error

Remove duplicate sentry log and fix failure if response content
has an unexpected format
This commit is contained in:
Sabrina Demagny
2025-03-27 15:41:00 +01:00
parent 4420bab073
commit 3173e096d9
4 changed files with 4 additions and 10 deletions

View File

@@ -406,5 +406,5 @@ def test_api_mail_domains__no_creation_when_dimail_duplicate(caplog):
assert record.levelname == "ERROR"
assert (
record.message
== "[DIMAIL] unexpected error : 409 {'detail': 'Domain already exists'}"
== "[DIMAIL] unexpected error: 409 {'detail': 'Domain already exists'}"
)

View File

@@ -721,7 +721,7 @@ def test_api_mailboxes__handling_dimail_unexpected_error(caplog):
assert caplog.records[0].levelname == "ERROR"
assert (
caplog.records[0].message
== "[DIMAIL] unexpected error : 500 {'detail': 'Internal server error'}"
== "[DIMAIL] unexpected error: 500 {'detail': 'Internal server error'}"
)