From 53bf5a07308fa778c1ad51ce141e79c440acd256 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Tue, 6 Aug 2024 12:40:39 -0400 Subject: [PATCH] Use why instead of e --- app/classes/web/routes/api/crafty/config/index.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/classes/web/routes/api/crafty/config/index.py b/app/classes/web/routes/api/crafty/config/index.py index fe33f161..85379316 100644 --- a/app/classes/web/routes/api/crafty/config/index.py +++ b/app/classes/web/routes/api/crafty/config/index.py @@ -100,18 +100,19 @@ class ApiCraftyConfigIndexHandler(BaseApiHandler): try: data = orjson.loads(self.request.body) - except orjson.JSONDecodeError as e: + except orjson.JSONDecodeError as why: return self.finish_json( - 400, {"status": "error", "error": "INVALID_JSON", "error_data": str(e)} + 400, + {"status": "error", "error": "INVALID_JSON", "error_data": str(why)}, ) try: validate(data, config_json_schema) - except ValidationError as e: - offending_key = e.path[0] if e.path else None + except ValidationError as why: + offending_key = why.path[0] if why.path else None err = f"""{self.translator.translate( "validators", - e.schema.get("error"), + why.schema.get("error"), self.controller.users.get_user_lang_by_id(auth_data[4]["user_id"]), )} {offending_key}""" return self.finish_json(