From 2c834309888441ec1df2bb2a97900eab50d8180b Mon Sep 17 00:00:00 2001 From: corbz Date: Sun, 18 Feb 2024 21:41:18 +0000 Subject: [PATCH] added an exception msg handler in pagination data --- src/utils.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index 67a3ec5..ee91b2a 100644 --- a/src/utils.py +++ b/src/utils.py @@ -192,7 +192,19 @@ class PaginationView(View): """ embed = self.embed.copy() - data, total_results = await self.getdata(self.index) + + try: + data, total_results = await self.getdata(self.index) + except aiohttp.ClientResponseError as exc: + log.error(exc) + await ( + Followup(f"Error ยท {exc.message}",) + .footer(f"HTTP {exc.code}") + .error() + .send(self.inter) + ) + raise exc + self.maxpage = self.calc_total_pages(total_results, self.pagesize) for i, item in enumerate(data):