From e18ba4152a149314bbe14d25d736fbaf8c841346 Mon Sep 17 00:00:00 2001 From: Pjotr Date: Sat, 3 Oct 2026 09:26:58 +0000 Subject: execute_bn_gom: show pipeline failures on the status page runTerminalCommand throws a RuntimeException when run.sh or run_octave fails, and execute_bn_gom.php had no try/catch -- the uncaught exception produced a blank page with no forward and no diagnosis (observed on production with real GeneNetwork datasets). Wrap the structure-learning pipeline in try/catch and render the error on the status page ("Structure learning FAILED: ..." plus a link back to the upload page) instead. --- sourcecodes/execute_bn_gom.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sourcecodes/execute_bn_gom.php') diff --git a/sourcecodes/execute_bn_gom.php b/sourcecodes/execute_bn_gom.php index 113841cc..3ff3f6e0 100644 --- a/sourcecodes/execute_bn_gom.php +++ b/sourcecodes/execute_bn_gom.php @@ -48,6 +48,8 @@ $thr=file_get_contents("$thrfile"); //$thr=valid_input($thr); $thr=trim($thr); +$bnw_error = NULL; +try { runTerminalCommand([realpath(__DIR__).'/run.sh', $keyval, $maxp, $maxk, $thr]); /////////////////////////////////structure matrix////////////////////////////////////////////////////////// @@ -114,6 +116,24 @@ if ($fout !== false) { runTerminalCommand([realpath(__DIR__.'/run_scripts/run_octave'), $keyval]); +} catch (Exception $e) { + $bnw_error = $e->getMessage(); +} + +if(!is_null($bnw_error)) +{ + // Structure learning failed: show it on the status page instead of + // a blank fatal error page with no forward. + ?> +

Structure learning FAILED:

+
+

Back to the data upload page

+ + + +