removed backtrace code from debug notice (replaced by error backtrace)
This commit is contained in:
parent
4d5280ce8f
commit
06907825ed
@ -38,6 +38,7 @@ class ErrorHandler {
|
|||||||
* @param \Exception $ex
|
* @param \Exception $ex
|
||||||
*/
|
*/
|
||||||
public function exceptionHandler(\Exception $ex) {
|
public function exceptionHandler(\Exception $ex) {
|
||||||
|
// Log exception
|
||||||
$message = "[ManiaControl EXCEPTION]: {$ex->getMessage()}";
|
$message = "[ManiaControl EXCEPTION]: {$ex->getMessage()}";
|
||||||
$traceMessage = 'Class: ' . get_class($ex) . PHP_EOL;
|
$traceMessage = 'Class: ' . get_class($ex) . PHP_EOL;
|
||||||
$traceMessage .= 'Trace:' . PHP_EOL . $ex->getTraceAsString();
|
$traceMessage .= 'Trace:' . PHP_EOL . $ex->getTraceAsString();
|
||||||
@ -95,7 +96,7 @@ class ErrorHandler {
|
|||||||
* @param $errorLine
|
* @param $errorLine
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function errorHandler($errorNumber, $errorString, $errorFile, $errorLine) {
|
public function errorHandler($errorNumber, $errorString, $errorFile = null, $errorLine = -1) {
|
||||||
if (error_reporting() == 0) {
|
if (error_reporting() == 0) {
|
||||||
// Error suppressed
|
// Error suppressed
|
||||||
return false;
|
return false;
|
||||||
@ -159,9 +160,7 @@ class ErrorHandler {
|
|||||||
* @param $message
|
* @param $message
|
||||||
*/
|
*/
|
||||||
public function triggerDebugNotice($message) {
|
public function triggerDebugNotice($message) {
|
||||||
$backtrace = debug_backtrace();
|
$this->errorHandler(self::MC_DEBUG_NOTICE, $message);
|
||||||
$callee = array_shift($backtrace);
|
|
||||||
$this->errorHandler(self::MC_DEBUG_NOTICE, $message, $callee['file'], $callee['line']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user