🐛(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

@@ -21,6 +21,7 @@ and this project adheres to
### Fixed
- 🐛(dimail) enhance sentry log
- 🐛(oauth2) force JWT signed for /userinfo #804
- 🐛(front) disable retries in useQuery and useInfiniteQuery #818

View File

@@ -251,15 +251,8 @@ class DimailAPIClient:
except json.decoder.JSONDecodeError:
error_content = response.content.decode(response.encoding)
logger.exception(
"[DIMAIL] unexpected error : %s %s",
response.status_code,
error_content,
exc_info=False,
)
raise requests.exceptions.HTTPError(
f"Unexpected response from dimail: {response.status_code} "
f"{error_content.get('detail') or error_content}"
f"[DIMAIL] unexpected error: {response.status_code} {error_content}"
)
def notify_mailbox_creation(self, recipient, mailbox_data, issuer=None):