Skip to content

Commit

Permalink
Fixing error_handler_dispatch: now exit properly after errors that st…
Browse files Browse the repository at this point in the history
…op application [#39 state:resolved]
  • Loading branch information
Fabrice Luraine committed May 15, 2010
1 parent 9438daf commit 264fa0c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/limonade.php
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,15 @@ function error_handler_dispatcher($errno, $errstr, $errfile, $errline)
else
{
# Other errors will stop application
$handlers = error();
static $handlers = array();
if(empty($handlers))
{
error(E_LIM_PHP, 'error_default_handler');
$handlers = error();
}

$is_http_err = http_response_status_is_valid($errno);
foreach($handlers as $handler)
while($handler = array_shift($handlers))
{
$e = is_array($handler['errno']) ? $handler['errno'] : array($handler['errno']);
while($ee = array_shift($e))
Expand All @@ -641,7 +647,6 @@ function error_handler_dispatcher($errno, $errstr, $errfile, $errline)
}
}
}
echo error_default_handler($errno, $errstr, $errfile, $errline);
}
}

Expand Down

0 comments on commit 264fa0c

Please sign in to comment.