mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
webhooks: Stop raising an exception if stream does not exist.
webhook-errors.log file is cluttered with Stream.DoesNotExist errors, which hides the errors that we actually need to see. So, since check_message already sends the bot_owner a PM if the webhook bot tries to send a message to a non-existent stream, we can ignore such exceptions.
This commit is contained in:
@@ -36,6 +36,7 @@ from zerver.lib.cache import (
|
||||
)
|
||||
from zerver.lib.context_managers import lockfile
|
||||
from zerver.lib.emoji import emoji_name_to_emoji_code, get_emoji_file_name
|
||||
from zerver.lib.exceptions import StreamDoesNotExistError
|
||||
from zerver.lib.hotspots import get_next_hotspots
|
||||
from zerver.lib.message import (
|
||||
access_message,
|
||||
@@ -1869,8 +1870,7 @@ def check_message(sender: UserProfile, client: Client, addressee: Addressee,
|
||||
|
||||
except Stream.DoesNotExist:
|
||||
send_pm_if_empty_stream(sender, None, stream_name, realm)
|
||||
raise JsonableError(_("Stream '%(stream_name)s' "
|
||||
"does not exist") % {'stream_name': escape(stream_name)})
|
||||
raise StreamDoesNotExistError(escape(stream_name))
|
||||
recipient = get_stream_recipient(stream.id)
|
||||
|
||||
if not stream.invite_only:
|
||||
|
||||
Reference in New Issue
Block a user