You can edit the laravel error handler only for warning messages in HandleExceptions.php
public function handleError($level, $message, $file = '', $line = 0, $context = [])
{
$exception = new ErrorException($message, 0, $level, $file, $line);
if (E_USER_WARNING & $level) {
$this->getExceptionHandler()->report($exception);
}
elseif (error_reporting() & $level) {
throw $exception;
}
}
User warning. Changing the vendor code is usually bad.
You can avoid changing the provider code by extending the class HandleExceptionsand registering a new class inKernel.php
MyHandleExceptions extends HandleExceptions {
public function handleError($level, $message, $file = '', $line = 0, $context = [])
{
if (E_USER_WARNING & $level) {
$this->getExceptionHandler()->report(new ErrorException($message, 0, $level, $file, $line));
}
else {
return parent::handleError($level, $message, $file, $line, $context);
}
}
}
source
share