diff options
author | 2021-03-05 02:27:35 +0100 | |
---|---|---|
committer | 2021-03-05 02:46:41 +0100 | |
commit | 64e5ba42675f0940995d75d2a3340791acd260c2 (patch) | |
tree | b58c6a17f29996c7919253d8a642327c948c9282 | |
parent | Correct typehint (diff) |
Set future result to None on exceptions
We can still provide th user with at least the link to the docs,
for which we already have handling in the cog with a generic
"unable to parse message", using exceptions for that would mean setting
it here, immediately catching it and then providing the same or very
similar message.
-rw-r--r-- | bot/exts/info/doc/_batch_parser.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/bot/exts/info/doc/_batch_parser.py b/bot/exts/info/doc/_batch_parser.py index d88b32208..a809fed78 100644 --- a/bot/exts/info/doc/_batch_parser.py +++ b/bot/exts/info/doc/_batch_parser.py @@ -141,14 +141,9 @@ class BatchParser: await doc_cache.set(item, markdown) else: scheduling.create_task(self.stale_inventory_notifier.send_warning(item)) - except Exception as e: + except Exception: log.exception(f"Unexpected error when handling {item}") - if markdown is not None: - future.set_result(markdown) - else: - future.set_exception(e) - else: - future.set_result(markdown) + future.set_result(markdown) del self._item_futures[item] await asyncio.sleep(0.1) finally: |