Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛(dimail) improve handling of dimail errors on failed mailbox creation #377

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

mjeammet
Copy link
Member

@mjeammet mjeammet commented Sep 4, 2024

Purpose

dimail is called twice when creating a mailbox (once for the token,
and once for the post on mailbox endpoint). we want to clarify
the status_codes and messages of each error to inform user and ease debug

Implementation

  • catch 403 from token
  • catch 403 from /mailboxes/new-address/
  • catch all other unexpected errors
  • 3 related tests

@mjeammet mjeammet changed the title 🐛(dimail) clarify different meanings of 403 from dimail 🐛(dimail) improve handling of dimail errors on failed mailbox creation Sep 4, 2024
@mjeammet mjeammet self-assigned this Sep 4, 2024
@mjeammet mjeammet force-pushed the mpj/clarify-dimail-errors branch 2 times, most recently from d1fa65b to 00ae0d5 Compare September 4, 2024 12:34
)

assert response.status_code == status.HTTP_403_FORBIDDEN
assert not models.Mailbox.objects.exists()
Copy link
Collaborator

@sdemagny sdemagny Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Est-ce qu'on veut pas aussi checker le détail de la response ici ?

dimail is called twice when creating a mailbox (once for the token,
and once for the post on mailbox endpoint). we want to clarify
the status_codes and messages of each error to inform user and ease debug
- in docker compose, remove obsolete 'version' field
- in django, replace obsolete CheckConstraints 'check' field by 'condition'
@mjeammet mjeammet merged commit 4b47f80 into main Sep 5, 2024
14 checks passed
@mjeammet mjeammet deleted the mpj/clarify-dimail-errors branch September 5, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants