(dimail) fix logger response in unauthorized response

a test was broken because of logger not logging errors
This commit is contained in:
Marie PUPO JEAMMET
2024-09-23 12:50:28 +02:00
committed by Marie
parent 5ded297df6
commit 7c6b3307fa
2 changed files with 18 additions and 10 deletions

View File

@@ -106,6 +106,10 @@ class DimailAPIClient:
return response
if response.status_code == status.HTTP_403_FORBIDDEN:
logger.error(
"[DIMAIL] 403 Forbidden: you cannot access domain %s",
str(mailbox["domain"]),
)
raise exceptions.PermissionDenied(
"Permission denied. Please check your MAIL_PROVISIONING_API_CREDENTIALS."
)