WebHost: Don't show e.__cause__ on the generation error page #5521

This commit is contained in:
NewSoupVi
2025-10-08 07:22:14 +02:00
committed by GitHub
parent 28ea2444a4
commit e355d20063

View File

@@ -97,8 +97,6 @@ def start_generation(options: dict[str, dict | str], meta: dict[str, Any]):
from .autolauncher import handle_generation_failure from .autolauncher import handle_generation_failure
handle_generation_failure(e) handle_generation_failure(e)
meta["error"] = format_exception(e) meta["error"] = format_exception(e)
if e.__cause__:
meta["source"] = format_exception(e.__cause__)
details = json.dumps(meta, indent=4).strip() details = json.dumps(meta, indent=4).strip()
return render_template("seedError.html", seed_error=meta["error"], details=details) return render_template("seedError.html", seed_error=meta["error"], details=details)
@@ -113,8 +111,6 @@ def start_generation(options: dict[str, dict | str], meta: dict[str, Any]):
from .autolauncher import handle_generation_failure from .autolauncher import handle_generation_failure
handle_generation_failure(e) handle_generation_failure(e)
meta["error"] = format_exception(e) meta["error"] = format_exception(e)
if e.__cause__:
meta["source"] = format_exception(e.__cause__)
details = json.dumps(meta, indent=4).strip() details = json.dumps(meta, indent=4).strip()
return render_template("seedError.html", seed_error=meta["error"], details=details) return render_template("seedError.html", seed_error=meta["error"], details=details)
@@ -190,8 +186,6 @@ def gen_game(gen_options: dict, meta: dict[str, Any] | None = None, owner=None,
meta["error"] = ("Allowed time for Generation exceeded, " + meta["error"] = ("Allowed time for Generation exceeded, " +
"please consider generating locally instead. " + "please consider generating locally instead. " +
format_exception(e)) format_exception(e))
if e.__cause__:
meta["source"] = format_exception(e.__cause__)
gen.meta = json.dumps(meta) gen.meta = json.dumps(meta)
commit() commit()
except BaseException as e: except BaseException as e:
@@ -202,8 +196,6 @@ def gen_game(gen_options: dict, meta: dict[str, Any] | None = None, owner=None,
gen.state = STATE_ERROR gen.state = STATE_ERROR
meta = json.loads(gen.meta) meta = json.loads(gen.meta)
meta["error"] = format_exception(e) meta["error"] = format_exception(e)
if e.__cause__:
meta["source"] = format_exception(e.__cause__)
gen.meta = json.dumps(meta) gen.meta = json.dumps(meta)
commit() commit()
raise raise