From 791f267399db6d6fa1e62fafa8a501422ce539bc Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Tue, 24 Oct 2023 12:49:49 +0200 Subject: [PATCH] Wrap UI creation in try catch block --- .../apps/formgrader/static/js/manage_assignments.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/e2xgrader/server_extensions/apps/formgrader/static/js/manage_assignments.js b/e2xgrader/server_extensions/apps/formgrader/static/js/manage_assignments.js index 9ed6b4ac..06c31267 100644 --- a/e2xgrader/server_extensions/apps/formgrader/static/js/manage_assignments.js +++ b/e2xgrader/server_extensions/apps/formgrader/static/js/manage_assignments.js @@ -699,10 +699,15 @@ let createAssignmentModal = function () { let tbl = $("#main-table"); let row = insertRow(tbl); - new AssignmentUI({ - model: model, - el: row, - }); + try { + new AssignmentUI({ + model: model, + el: row, + }); + } catch (e) { + console.err("Failed to create new view", e); + } + model.save(); tbl.parent().DataTable().row.add(row).draw();