# Buggy code
def add_error_handler(self, callback):
    """Registers an error handler in the Dispatcher. This handler will receive every error
    which happens in your bot.

    Warning: The errors handled within these handlers won't show up in the logger, so you
    need to make sure that you reraise the error.

    Args:
        callback (:obj:`callable`): The callback function for this error handler. Will be
            called when an error is raised. Callback signature for context based API:

            ``def callback(update: Update, context: CallbackContext)``

            The error that happened will be present in context.error.

    Note:
        See https://git.io/fxJuV for more info about switching to context based API.
    """
    self.error_handlers.append(callback)


# Traceback (telegram.error.BadRequest)
<project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /async_start
2017-06-20 23:24:12,188 - telegram.utils.promise - ERROR - An uncaught error was raised while running the promise
Traceback (most recent call last):
File "<project_path>/venv/src/python-telegram-bot/telegram/utils/promise.py", line 42, in run
self._result = self.pooled_function(*self.args, **self.kwargs)
File "<project_path>/issue.py", line 25, in action_async_start
update.message.reply_text(msg, parse_mode=ParseMode.HTML)
File "<project_path>/venv/src/python-telegram-bot/telegram/message.py", line 340, in reply_text
return self.bot.send_message(self.chat_id, *args, **kwargs)
File "<project_path>/venv/src/python-telegram-bot/telegram/bot.py", line 125, in decorator
result = func(self, *args, **kwargs)
File "<project_path>/venv/src/python-telegram-bot/telegram/bot.py", line 158, in decorator
return Bot._message_wrapper(self, url, data, *args, **kwargs)
File "<project_path>/venv/src/python-telegram-bot/telegram/bot.py", line 146, in _message_wrapper
result = self._request.post(url, data, timeout=kwargs.get('timeout'))
File "<project_path>/venv/src/python-telegram-bot/telegram/utils/request.py", line 252, in post
**urlopen_kwargs)
File "<project_path>/venv/src/python-telegram-bot/telegram/utils/request.py", line 194, in _request_wrapper
raise BadRequest(message)
telegram.error.BadRequest: Can't parse entities in message text: unsupported start tag "invalid_tag" at byte offset 0

Process finished with exit code 0

# Fixed code
def add_error_handler(self, callback, run_async=False):
    """Registers an error handler in the Dispatcher. This handler will receive every error
    which happens in your bot.

    Note:
        Attempts to add the same callback multiple times will be ignored.

    Warning:
        The errors handled within these handlers won't show up in the logger, so you
        need to make sure that you reraise the error.

    Args:
        callback (:obj:`callable`): The callback function for this error handler. Will be
            called when an error is raised. Callback signature for context based API:

            ``def callback(update: Update, context: CallbackContext)``

            The error that happened will be present in context.error.
        run_async (:obj:`bool`, optional): Whether this handlers callback should be run
            asynchronously using :meth:`run_async`. Defaults to :obj:`False`.

    Note:
        See https://git.io/fxJuV for more info about switching to context based API.
    """
    if callback in self.error_handlers:
        self.logger.debug(
            "The callback is already registered as an error handler. Ignoring."
        )
        return
    self.error_handlers[callback] = run_async