improved connection exception reporting
This commit is contained in:
parent
8a068a256d
commit
429702d2e6
@ -48,7 +48,7 @@ class ErrorHandler {
|
||||
*
|
||||
* @param \Exception $ex
|
||||
*/
|
||||
public function exceptionHandler(\Exception $ex) {
|
||||
public function exceptionHandler(\Exception $ex, $shutdown = true) {
|
||||
// Log exception
|
||||
$message = "[ManiaControl EXCEPTION]: {$ex->getMessage()}";
|
||||
$traceMessage = 'Class: ' . get_class($ex) . PHP_EOL;
|
||||
@ -93,10 +93,12 @@ class ErrorHandler {
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->shouldRestart()) {
|
||||
$this->maniaControl->restart();
|
||||
if ($shutdown) {
|
||||
if ($this->shouldRestart()) {
|
||||
$this->maniaControl->restart();
|
||||
}
|
||||
exit();
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -231,7 +233,6 @@ class ErrorHandler {
|
||||
|
||||
/**
|
||||
* Parse the Debug Backtrace into a String for the Error Report
|
||||
*
|
||||
* return string
|
||||
*/
|
||||
private function parseBackTrace(array $backtrace) {
|
||||
|
@ -353,7 +353,7 @@ class ManiaControl implements CommandListener, TimerListener {
|
||||
$this->log("Connection interrupted!");
|
||||
// TODO remove
|
||||
if ($this->errorHandler) {
|
||||
$this->errorHandler->triggerDebugNotice("Fatal Exception: " . $e->getMessage() . " Trace: " . $e->getTraceAsString());
|
||||
$this->errorHandler->exceptionHandler($e, false);
|
||||
}
|
||||
$this->quit($e->getMessage());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user