Skip to content

Commit c42459a

Browse files
committed
Show debug trace when debug mode on for check_return_code
1 parent 2c90f9f commit c42459a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

web/edit/server/index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@
308308
unset($output);
309309
$v_hostname = $_POST["v_hostname"];
310310
}
311+
311312
if ($_SESSION["WEB_BACKEND"] == "php-fpm") {
312313
// Install/remove php versions
313314
if (empty($_SESSION["error_msg"])) {

web/inc/main.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ function check_return_code($return_var, $output) {
179179
if (empty($error)) {
180180
$error = sprintf(_("Error code: %s"), $return_var);
181181
}
182+
183+
// Add backtrace if debug mode is activated to find out the cause
184+
if ($_SESSION["DEBUG_MODE"] == "true") {
185+
$error .= " | DEBUG BACKTRACE: " . var_export(debug_backtrace(), true);
186+
}
187+
182188
$_SESSION["error_msg"] = $error;
183189
}
184190
}

0 commit comments

Comments
 (0)