Catch error better

pull/159/head
bobloy 4 years ago
parent ca8c762e69
commit a946b1b83b

@ -95,13 +95,16 @@ class RedConfigJobStore(MemoryJobStore):
job_state = in_job["job_state"] job_state = in_job["job_state"]
job_state = pickle.loads(base64.b64decode(job_state)) job_state = pickle.loads(base64.b64decode(job_state))
if job_state["args"]: # Backwards compatibility on args to kwargs if job_state["args"]: # Backwards compatibility on args to kwargs
job_state["kwargs"] = { try:
"name": job_state["args"][0], job_state["kwargs"] = {
"guild_id": job_state["args"][1], "name": job_state["args"][0],
"author_id": job_state["args"][2], "guild_id": job_state["args"][1],
"channel_id": job_state["args"][3], "author_id": job_state["args"][2],
"bot": job_state["args"][4], "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"]["config"] = self.config
job_state["kwargs"]["bot"] = self.bot job_state["kwargs"]["bot"] = self.bot
# new_kwargs = job_state["kwargs"] # new_kwargs = job_state["kwargs"]

Loading…
Cancel
Save