How to use the zulip.integrations.bridge_with_matrix.matrix_bridge.Bridge_ZulipFatalException function in zulip

To help you get started, we’ve selected a few zulip examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zulip / python-zulip-api / zulip / integrations / bridge_with_matrix / matrix_bridge.py View on Github external
# and we make sure we don't forward it again to the Zulip stream.
        not_from_zulip_bot = ('body' not in event['content'] or
                              event['sender'] != zulip_bot_user)

        if not_from_zulip_bot and content:
            try:
                result = zulip_client.send_message({
                    "sender": zulip_client.email,
                    "type": "stream",
                    "to": zulip_config["stream"],
                    "subject": zulip_config["topic"],
                    "content": content,
                })
            except Exception as exception:  # XXX This should be more specific
                # Generally raised when user is forbidden
                raise Bridge_ZulipFatalException(exception)
            if result['result'] != 'success':
                # Generally raised when API key is invalid
                raise Bridge_ZulipFatalException(result['msg'])
github zulip / python-zulip-api / zulip / integrations / bridge_with_matrix / matrix_bridge.py View on Github external
if not_from_zulip_bot and content:
            try:
                result = zulip_client.send_message({
                    "sender": zulip_client.email,
                    "type": "stream",
                    "to": zulip_config["stream"],
                    "subject": zulip_config["topic"],
                    "content": content,
                })
            except Exception as exception:  # XXX This should be more specific
                # Generally raised when user is forbidden
                raise Bridge_ZulipFatalException(exception)
            if result['result'] != 'success':
                # Generally raised when API key is invalid
                raise Bridge_ZulipFatalException(result['msg'])