[Trivia] Handle potential Discord errors in session (#5172)

* [Trivia] Handle potential Discord errors in session.

* Hm why did I put HTTPException in there

* Revert "Hm why did I put HTTPException in there"

This reverts commit dc5cb990cb9632c52f322076c69a0c1568c9eab0.

* Revert "[Trivia] Handle potential Discord errors in session."

This reverts commit d90e45f9e0188cfeaef914a78eda5f397730a47a.

* Handle Discord errors in _error_handler.
This commit is contained in:
PredaaA 2021-09-04 00:36:48 +02:00 committed by GitHub
parent 36ea867dcf
commit 42edb12b2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,6 +114,8 @@ class TriviaSession:
fut.result() fut.result()
except asyncio.CancelledError: except asyncio.CancelledError:
pass pass
except (discord.NotFound, discord.Forbidden):
self.stop()
except Exception as exc: except Exception as exc:
LOG.error("A trivia session has encountered an error.\n", exc_info=exc) LOG.error("A trivia session has encountered an error.\n", exc_info=exc)
asyncio.create_task( asyncio.create_task(