Sets the error cache to true and propagates the information
upwards the Result-Object Tree

@return void
547754
protected function setErrorsExist()
    {
        $this->errorsExist = true;
        if ($this->parent !== null) {
            $this->parent->setErrorsExist();
        }
    }
869347
protected function setCache()
    {
        // Check if cache has expired
        if ($this->cache->expired() === false) {
            return;
        }

        // Instantiate values
        $values = array();

        // Get values from database
        foreach($this->database->table($this->config['table'])->get() as $setting)
        {
            $values[$setting->key] = json_decode($setting->value, true);
        }

        // Cache values
        $this->cache->set($values);
    }
1061132
private function printErrors(iterable $errors): void
    {
        $hasErrors = false;

        foreach ($errors as $error) {
            $hasErrors = true;

            /** @var ErrorInterface $error */
            $paramName  = $error->getParameterName();
            $entry      = empty($paramName) ? 'Validation' : "Param `$paramName`";
            $paramValue = $error->getParameterValue();
            $errorMsg   = $error->getMessageTemplate();
            $context    = $error->getMessageParameters();
            $errorMsg   = MessageFormatter::formatMessage('en', $errorMsg, $context !== null ? $context : []);

            $this->console("$entry failed for `$paramValue` with: $errorMsg" . PHP_EOL);
        }

        if ($hasErrors === false) {
            $this->console('No errors' . PHP_EOL);
        }
    }
512790
public function setErrors($errors)
    {
        $this->errors = strtolower((string) $errors);

        $message = sprintf("Set errors flag to [%s].", $this->errors);
        $this->log($message, Project::MSG_DEBUG);
    }
101419
public function error() {
        $error = $this->request->url(2);
        $error_layout = Config::get('Error.layout');
        $this->view->setLayout($error_layout ? $error_layout : 'error');
        
        if ( in_array($error, [500, 404]) ) {
            $this->response->defaultHeader($error);
            $this->view->setTemplate( is_file(PO_PATH_TEMPLATES . DS . 'error' . DS . 'error-' . $error . '.phtml') ? 
                    'error-' . $error : 'default', 'error');
        } else {
            $this->view->setTemplate('default', 'error');
        }
    }
339817
protected function printErrors(): void
    {
        $this->output->writeln('');
        $this->output->writeln('');

        foreach ($this->errors as $error) {
            $this->output->write('<fg=red>ERROR   </> ' . $error['file'] . ':' . $error['line'] . ' - ');

            if ($error['type'] == 'class') {
                $this->output->write('Class <info>' . $error['class'] . '</info> is missing a docblock.');
            }

            if ($error['type'] == 'method') {
                $this->output->write('Method <info>' . $error['method'] . '</info> is missing a docblock.');
            }

            $this->output->writeln('');
        }
    }
783331
protected function setErrorReporting()
    {
        /**
         * Configure how verbose PHP is; Everything except E_STRICT and E_ERROR;
         * we'll let the errorHandler pick up fatal errors
         */

        error_reporting(E_ALL ^ E_STRICT ^ E_ERROR);

        //  Configure whether errors are shown or no
        if (function_exists('ini_set')) {
            switch (Environment::get()) {
                case Environment::ENV_PROD:
                    //  Suppress all errors on production
                    ini_set('display_errors', false);
                    break;
                default:
                    //  Show errors everywhere else
                    ini_set('display_errors', true);
                    break;
            }
        }
    }
1348375
protected function loadCache()
	{
		if ($this->getSetting(self::SET_CACHE_RATELIMIT, false))
		{
			//  ratelimit cache enabled, try to load already existing object
			$rlc = $this->cache->load(self::CACHE_KEY_RLC);
			if ($rlc == false)
				//  nothing loaded, creating new instance
				$rlc = new RateLimitControl($this->regions);

			$this->rlc = $rlc;
		}

		if ($this->getSetting(self::SET_CACHE_CALLS, false))
		{
			//  call cache enabled, try to load already existing object
			$callCache = $this->cache->load(self::CACHE_KEY_CCC);
			if ($callCache == false)
				//  nothing loaded, creating new instance
				$callCache = new CallCacheControl();

			$this->ccc = $callCache;
		}
	}
940128
public static function setEnvironment(): void
    {
        error_reporting(E_ALL);
        set_error_handler(function ($errno, $errstr, $errfile, $errline, array $errcontext): bool {
            if (!(error_reporting() & $errno)) {
                // respect error_reporting() level
                // libraries used in custom components may emit notices that cannot be fixed
                return false;
            }

            throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
        });
    }
279599
public function error($e): void
  {
    $this->has_error = true;
    self::has_error();
    $msg = [
      self::$line,
      self::get_log_line('ERROR DB!'),
      self::$line
    ];
    if ( \is_string($e) ){
      $msg[] = self::get_log_line('USER MESSAGE');
      $msg[] = $e;
    }
    else if ( method_exists($e, 'getMessage') ){
      $msg[] = self::get_log_line('DB MESSAGE');
      $msg[] = $e->getMessage();
    }
    $this->last_error = end($msg);
    $msg[] = self::get_log_line('QUERY');
    $msg[] = $this->last();
    if ( $this->last_params['values'] ){
      $msg[] =  self::get_log_line('VALUES');
      foreach ( $this->last_params['values'] as $v ){
        if ( $v === null ){
          $msg[] = 'NULL';
        }
        else if ( \is_bool($v) ){
          $msg[] = $v ? 'TRUE' : 'FALSE';
        }
        else if ( \is_string($v) ){
          $msg[] = str::is_buid($v) ? bin2hex($v) : str::cut($v, 30);
        }
        else{
          $msg[] = $v;
        }
      }
    }
    $msg[] =  self::get_log_line('BACKTRACE');
    $dbt = array_reverse(debug_backtrace());
    array_walk($dbt, function($a, $i) use(&$msg){
      $msg[] = str_repeat(' ', $i).($i ? '->' : '')."{$a['function']}  (".basename(dirname($a['file'])).'/'.basename($a['file']).":{$a['line']})";
    });
    $this->log(implode(PHP_EOL, $msg));
    if ( $this->on_error === self::E_DIE ){
      die(\defined('BBN_IS_DEV') && BBN_IS_DEV ? '<pre>'.PHP_EOL.implode(PHP_EOL, $msg).PHP_EOL.'</pre>' : 'Database error');
    }
  }
574277
public function raiseError() {
		$error = $this->getError();

		if ($error === false) {
			return;
		}

		$this->_error = false;
		if ($error['offset'] == 0) {
			$message = sprintf('%s', $error['message']);
		}
		else {
			$message = sprintf('%s in %s at %s', $error['message'], $error['sqltext'], $error['offset']);
		}
		switch($this->getAttribute(PDO::ATTR_ERRMODE)) {
			case PDO::ERRMODE_SILENT:
				$message = sprintf('(%s) Error ' . $message, date('Y-m-d H:i:s'));
				error_log($message);
				break;
			case PDO::ERRMODE_WARNING:
				$message = 'Error ' . $message;
				$message = htmlentities($message, ENT_QUOTES);
				trigger_error($message, E_USER_ERROR);
				break;
			case PDO::ERRMODE_EXCEPTION:
			default:
				throw new Exception($message, $error['code']);
		}
	}
701602
protected function onError() {
        global $OUTPUT;

        $message = $this->message;
        if ($this->debugMode && !empty($this->reason)) {
            $message = $this->reason;
        }

        // Display the error message from the provider's side if the consumer has not specified a URL to pass the error to.
        if (empty($this->returnUrl)) {
            $this->errorOutput = $OUTPUT->notification(get_string('failedrequest', 'enrol_lti', ['reason' => $message]), 'error');
        }
    }
1314867
protected function resetError()
    {
        IntlGlobals::setError(IntlGlobals::U_ZERO_ERROR);
        $this->errorCode = IntlGlobals::getErrorCode();
        $this->errorMessage = IntlGlobals::getErrorMessage();
    }
530411
protected function setError($resource)
    {
        if (is_string($resource)) {
            $this->getDriver()->setError(
                $resource, -1
            );
        } else {
            $this->getDriver()->setError(
                $this->realError($resource),
                $this->realErrorCode($resource)
            );
        }
    }
278472
public function abortCacheGeneration()
    {
        eZDebugSetting::writeDebug( 'kernel-clustering', 'Aborting cache generation', "dfs::abortCacheGeneration( '{$this->filePath}' )" );
        self::$dbbackend->_abortCacheGeneration( $this->filePath );
        $this->filePath = $this->realFilePath;
        $this->realFilePath = null;
        eZClusterFileHandler::removeGeneratingFile( $this );
    }
1067137
public function Validate()
	{
		// force re-validation
		$this->ResetValidationErrors();

		$is_valid = (!$this->HasValidationErrors());

		// if validation fails, remove this object from the cache otherwise invalid values can
		// hang around and cause troubles.
		if (!$is_valid)
		{
			$this->_phreezer->DeleteCache(get_class($this), $this->GetPrimaryKeyValue());
		}

		return $is_valid;
	}
489531
public static function clear() {
        try {
            self::getCache()->clear();
            self::release();
        } catch (\RuntimeException $e) {
            self::release();
            throw $e;
        } catch (\Error $e) {
            self::release();
            throw $e;
        }
    }