public function errorHandler($errno, $errstr, $errfile, $errline)
    {
        // Honour error suppression through @
        if (($errorReporting = error_reporting()) === 0) {
            return true;
        }
        
        $logType = null;

        foreach ($this->errorLogGroups as $candidateLogType => $errorTypes) {
            if (in_array($errno, $errorTypes)) {
                $logType = $candidateLogType;
                break;
            }
        }
        
        if (is_null($logType)) {
            throw new \Exception(sprintf(
                "No log type found for errno '%s'",
                $errno
            ));
        }

        $exception = $this->createException($errstr, $errno, $errfile, $errline);
        
        // Log all errors regardless of type
        $context = array(
            'file' => $errfile,
            'line' => $errline
        );
    
        if ($this->reportBacktrace) {
            $context['backtrace'] = $this->getBacktraceReporter()->getBacktrace();
        }

        if ($this->exceptionInContext) {
            $context['exception'] = $exception;
        }
    
        $this->logger->$logType($errstr, $context);
    
        // Check the error_reporting level in comparison with the $errno (honouring the environment)
        // And check that $showErrors is on or the site is live
        if (($errno & $errorReporting) === $errno &&
            ($this->showErrors || $this->getEnvReporter()->isLive())) {
            $this->getErrorReporter()->reportError($exception);
        }
            
        if (in_array($errno, $this->terminatingErrors)) {
            $this->terminate();
        }
        
        // ignore the usually handling of this type of error
        return true;
    }