def format_subject(self, subject):

        formatted_subject = subject.replace('\n', '\\n').replace('\r', '\\r')

        return formatted_subject[:989]
Escape CR and LF characters, and limit length. RFC 2822's hard limit is
dataset/ETHPy150Open lamby/django-slack/django_slack/log.py/SlackExceptionHandler.format_subject