mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-10 07:21:04 +01:00
always add exception code to the logged exception
This commit is contained in:
parent
9a408f40ac
commit
9dd62ad9a0
@ -112,7 +112,7 @@ function egw_exception_handler($e)
|
|||||||
// exception handler for cli (command line interface) clients, no html, no logging
|
// exception handler for cli (command line interface) clients, no html, no logging
|
||||||
if(!isset($_SERVER['HTTP_HOST']) || $GLOBALS['egw_info']['flags']['no_exception_handler'] == 'cli')
|
if(!isset($_SERVER['HTTP_HOST']) || $GLOBALS['egw_info']['flags']['no_exception_handler'] == 'cli')
|
||||||
{
|
{
|
||||||
echo ($headline ? $headline.': ' : '').$e->getMessage()."\n";
|
echo ($headline ? $headline.': ' : '').$e->getMessage().' ('.$e->getCode().')'."\n";
|
||||||
echo $e->getFile().' ('.$e->getLine().")\n";
|
echo $e->getFile().' ('.$e->getLine().")\n";
|
||||||
if ($GLOBALS['egw_info']['server']['exception_show_trace'])
|
if ($GLOBALS['egw_info']['server']['exception_show_trace'])
|
||||||
{
|
{
|
||||||
@ -125,7 +125,7 @@ function egw_exception_handler($e)
|
|||||||
{
|
{
|
||||||
header('HTTP/1.1 500 '.$headline);
|
header('HTTP/1.1 500 '.$headline);
|
||||||
$message = '<h3>'.Api\Html::htmlspecialchars($headline)."</h3>\n".
|
$message = '<h3>'.Api\Html::htmlspecialchars($headline)."</h3>\n".
|
||||||
'<pre><b>'.Api\Html::htmlspecialchars($e->getMessage())."</b>\n\n";
|
'<pre><b>'.Api\Html::htmlspecialchars($e->getMessage().' ('.$e->getCode().')')."</b>\n\n";
|
||||||
|
|
||||||
echo $e->getFile().' ('.$e->getLine().")\n";
|
echo $e->getFile().' ('.$e->getLine().")\n";
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ function egw_exception_handler($e)
|
|||||||
// exception handler sending message back to the client as basic auth message
|
// exception handler sending message back to the client as basic auth message
|
||||||
elseif($GLOBALS['egw_info']['flags']['no_exception_handler'] == 'basic_auth')
|
elseif($GLOBALS['egw_info']['flags']['no_exception_handler'] == 'basic_auth')
|
||||||
{
|
{
|
||||||
$error = str_replace(array("\r", "\n"), array('', ' | '), $e->getMessage());
|
$error = str_replace(array("\r", "\n"), array('', ' | '), $e->getMessage().' ('.$e->getCode().')');
|
||||||
// to long http header cause Nginx to reject the response with 502 upstream sent too big header while reading response header from upstream
|
// to long http header cause Nginx to reject the response with 502 upstream sent too big header while reading response header from upstream
|
||||||
if (strlen($error) > 256) $error = substr($error, 0, 256).' ...';
|
if (strlen($error) > 256) $error = substr($error, 0, 256).' ...';
|
||||||
header('WWW-Authenticate: Basic realm="'.$headline.' '.$error.'"');
|
header('WWW-Authenticate: Basic realm="'.$headline.' '.$error.'"');
|
||||||
|
Loading…
Reference in New Issue
Block a user