From a946b1b83b35526d872eb8617d66bbbbcce32a53 Mon Sep 17 00:00:00 2001 From: bobloy Date: Tue, 17 Nov 2020 15:30:07 -0500 Subject: [PATCH] Catch error better --- fifo/redconfigjobstore.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/fifo/redconfigjobstore.py b/fifo/redconfigjobstore.py index 27324f6..dee020a 100644 --- a/fifo/redconfigjobstore.py +++ b/fifo/redconfigjobstore.py @@ -95,13 +95,16 @@ class RedConfigJobStore(MemoryJobStore): job_state = in_job["job_state"] job_state = pickle.loads(base64.b64decode(job_state)) if job_state["args"]: # Backwards compatibility on args to kwargs - job_state["kwargs"] = { - "name": job_state["args"][0], - "guild_id": job_state["args"][1], - "author_id": job_state["args"][2], - "channel_id": job_state["args"][3], - "bot": job_state["args"][4], - } + try: + job_state["kwargs"] = { + "name": job_state["args"][0], + "guild_id": job_state["args"][1], + "author_id": job_state["args"][2], + "channel_id": job_state["args"][3], + "bot": job_state["args"][4], + } + except IndexError as e: + raise Exception(job_state["args"]) from e job_state["kwargs"]["config"] = self.config job_state["kwargs"]["bot"] = self.bot # new_kwargs = job_state["kwargs"]