if loading or test run fail, complain and delete file

This commit is contained in:
NichtJens
2025-11-03 12:44:33 +01:00
committed by Auf keinen Fall Jens
parent fbe6ecb882
commit ce2c5ea601
+10 -3
View File
@@ -249,10 +249,17 @@ class DetectorManager:
code = request["code"]
fn = write_code_to_file(name, code, beamline)
func = load_proc_from_file(fn)
test_run(func)
# commit to git ... or delete and complain
try:
func = load_proc_from_file(fn)
test_run(func)
except:
_logger.exception(f'uploading custom DAP script "{name}" for {beamline} failed')
if os.path.exists(fn):
os.remove(fn)
raise
# commit to git
def get_dap_settings(self, request, remote_ip):