Skip to content

Commit 0d874bd

Browse files
feat: Send email on IPR mail ingestion error
1 parent 1c07ad5 commit 0d874bd

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

ietf/ipr/utils.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright The IETF Trust 2014-2020, All Rights Reserved
22
# -*- coding: utf-8 -*-
33

4+
from textwrap import dedent
5+
46
from ietf.ipr.mail import process_response_email
57
from ietf.ipr.models import IprDocRel
68

@@ -91,8 +93,15 @@ def ingest_response_email(message: bytes):
9193
from ietf.api.views import EmailIngestionError # avoid circular import
9294
try:
9395
result = process_response_email(message)
94-
except Exception:
95-
raise EmailIngestionError("Unable to process message as an IPR response email")
96+
except Exception as err:
97+
raise EmailIngestionError(
98+
"Error ingesting IPR email",
99+
email_body=dedent("""\
100+
An error occurred while ingesting IPR email.
101+
102+
{error_summary}
103+
"""),
104+
) from err
96105

97106
if result is None:
98107
raise EmailIngestionError("Message rejected")

0 commit comments

Comments
 (0)