mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
bug: Fix traceback in get_missed_message_token_from_address().
If you supplied an unrecognizable address to our email system, or you had EMAIL_GATEWAY_PATTERN configured wrong, the get_missed_message_token_from_address() used to crash hard and cryptically with a traceback saying that you can't call startswith() on a None object. Now we throw a ZulipEmailForwardError exception. This will still lead to a traceback, but it should be easier to diagnose the problem.
This commit is contained in:
@@ -90,6 +90,9 @@ def get_missed_message_token_from_address(address):
|
||||
# type: (text_type) -> text_type
|
||||
msg_string = get_email_gateway_message_string_from_address(address)
|
||||
|
||||
if msg_string is None:
|
||||
raise ZulipEmailForwardError('Address not recognized by gateway.')
|
||||
|
||||
if not is_mm_32_format(msg_string):
|
||||
raise ZulipEmailForwardError('Could not parse missed message address')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user