diff options
| author | Pjotr <wrk@bosa.lan> | 2026-10-03 09:26:58 +0000 |
|---|---|---|
| committer | Pjotr <wrk@bosa.lan> | 2026-10-03 09:26:58 +0000 |
| commit | e18ba4152a149314bbe14d25d736fbaf8c841346 (patch) | |
| tree | 9178dd58517e289e108d606d3de651cda5d9b50a /sourcecodes/execute_bn_gom.php | |
| parent | 1de3cbe0d94ef024945661f3c9d574e3990183c4 (diff) | |
| download | gn-bnw-e18ba4152a149314bbe14d25d736fbaf8c841346.tar.gz | |
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.
Diffstat (limited to 'sourcecodes/execute_bn_gom.php')
| -rw-r--r-- | sourcecodes/execute_bn_gom.php | 20 |
1 files changed, 20 insertions, 0 deletions
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. + ?> + <p style="color: red;">Structure learning FAILED:</p> + <pre><?php print(htmlspecialchars($bnw_error)); ?></pre> + <p><a href="bn_genenet.php">Back to the data upload page</a></p> + </div> + </body> + </html> + <?php + exit(1); +} ?> <script> |
