ErrorHandling/Fixup

* do not write to STDERR from web context
This commit is contained in:
Sarjuuk
2025-01-27 09:52:04 +01:00
parent 88da3588e5
commit 88c066a8f5

View File

@@ -153,8 +153,10 @@ register_shutdown_function(function()
AOWOW_REVISION, $e['type'], $e['file'], $e['line'], CLI ? 'CLI' : ($_SERVER['QUERY_STRING'] ?? ''), empty($_POST) ? '' : http_build_query($_POST), User::$groups, $e['message']
);
if (CLI || User::isInGroup(U_GROUP_EMPLOYEE))
if (CLI)
fwrite(STDERR, "\nFatal Error - ".$e['message'].' @ '.$e['file']. ':'.$e['line']."\n\n");
else if (User::isInGroup(U_GROUP_EMPLOYEE))
echo "\nFatal Error - ".$e['message'].' @ '.$e['file']. ':'.$e['line']."\n\n";
}
});