# Buggy code
def _pooled(self):
    thr_name = current_thread().getName()
    while 1:
        promise = self.__async_queue.get()

        # If unpacking fails, the thread pool is being closed from Updater._join_async_threads
        if not isinstance(promise, Promise):
            self.logger.debug(
                "Closing run_async thread %s/%d", thr_name, len(self.__async_threads)
            )
            break

        promise.run()
        if isinstance(promise.exception, DispatcherHandlerStop):
            self.logger.warning(
                "DispatcherHandlerStop is not supported with async functions; func: %s",
                promise.pooled_function.__name__,
            )


# 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 _pooled(self):
    thr_name = current_thread().getName()
    while 1:
        promise = self.__async_queue.get()

        # If unpacking fails, the thread pool is being closed from Updater._join_async_threads
        if not isinstance(promise, Promise):
            self.logger.debug(
                "Closing run_async thread %s/%d", thr_name, len(self.__async_threads)
            )
            break

        promise.run()

        if not promise.exception:
            self.update_persistence(update=promise.update)
            continue

        if isinstance(promise.exception, DispatcherHandlerStop):
            self.logger.warning(
                "DispatcherHandlerStop is not supported with async functions; func: %s",
                promise.pooled_function.__name__,
            )
            continue

        # Avoid infinite recursion of error handlers.
        if promise.pooled_function in self.error_handlers:
            self.logger.error("An uncaught error was raised while handling the error.")
            continue

        # Don't perform error handling for a `Promise` with deactivated error handling. This
        # should happen only via the deprecated `@run_async` decorator or `Promises` created
        # within error handlers
        if not promise.error_handling:
            self.logger.error(
                "A promise with deactivated error handling raised an error."
            )
            continue

        # If we arrive here, an exception happened in the promise and was neither
        # DispatcherHandlerStop nor raised by an error handler. So we can and must handle it
        try:
            self.dispatch_error(promise.update, promise.exception, promise=promise)
        except Exception:
            self.logger.exception(
                "An uncaught error was raised while handling the error."
            )