From 55b4da42af2a2617bd2ee5d7de5e82b3e44390ea Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 26 Aug 2020 09:42:15 -0400 Subject: [PATCH] Prevent 500 on invalid build manifests --- hubsrht/builds.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hubsrht/builds.py b/hubsrht/builds.py index cb65e10..aa6d997 100644 --- a/hubsrht/builds.py +++ b/hubsrht/builds.py @@ -64,7 +64,11 @@ def submit_patchset(ml, payload): lists.patchset_set_tool(ml.owner, ml.name, payload["id"], tool_key, "pending", f"build pending: {key}") - manifest = Manifest(yaml.safe_load(value)) + try: + manifest = Manifest(yaml.safe_load(value)) + except: + # TODO: Maybe we should email the user with the error details? + return # TODO: https://todo.sr.ht/~sircmpwn/builds.sr.ht/291 task = Task({ "_apply_patch": f"""echo Applying patch from lists.sr.ht