start the error bag

@return mixed
548393
public function init(){
        if ($errors = Session::has(self::SESSION_ERROR_NAME)) {
            $this->errors = $errors;
        }

        $this->clean();

        return;
    }
887984
public function getErrorResponse(Exception $e, ErrorBag $errorBag)
    {
        if (config('app.debug')) {
            throw $e;
        }

        return parent::getErrorResponse($e, $errorBag);
    }
1299181
public function start()
    {
        $routeMethodSep = '>';
        $storage = $this->routeService->getStorage();
        foreach ($storage as $match => $route) {
            if (($matched = $this->matchHttpRequest($match)) !== false) {
                if (!in_array($this->request->getMethod(), $route->methods)) {
                    throw new MethodNotAllowedException();
                }
                $this->request->withAttributes($matched);

                $middleWares = new MiddleWares($this->getMiddleWareFromRoute($route));
                $decorators = $route->decorators;

                if (\is_string($route->callback)) {
                    if (strpos($route->callback, $routeMethodSep) !== false) {
                        list($controller, $method) = explode($routeMethodSep, $route->callback);
                        return $this->connectMiddlewares($controller, $method, $middleWares, $decorators);
                    }
                }

                return $this->connectMiddlewares($route->callback, '__invoke', $middleWares, $decorators);
            }
        }

        throw new NotFoundException();
    }
369285
protected function setupBorisErrorHandling()
	{
		restore_error_handler(); restore_exception_handler();

		$this->flyphp->make('flyconsole')->setCatchExceptions(false);

		$this->flyphp->error(function() { return ''; });
	}
41351
public function writeError( $s )
	{
		$message = $this->cleanMessage( $s );

		if ( ! empty( $message ) )
		{
			$this->bag[] = array( self::ERROR , $message );
		}
	}
762340
public function setErrors(MessageBag $errors)
    {
        $this->errors = $errors;

        // Add status message to meta array
        if (!$errors->isEmpty()) {
            $this->addMeta(['errors' => $errors->all()]);
        }

        return $this;
    }
868492
public function getUserBag()
    {
        $userBag = new UserBag();
        $userBag->setLogin($this->cookieBag->get(self::CLIENT_LOGIN_KEY))
                ->setPasswordHash($this->cookieBag->get(self::CLIENT_LOGIN_PASSWORD_HASH_KEY));

        return $userBag;
    }
646053
protected function _startErrorHandler()
    {
        $this->_whoops = new Run();
        $environment = $this->getConfiguration()
            ->get('environment', 'production');

        switch ($environment) {
            case 'production':
                $handler = new Production();
                $handler->setApplication($this);
                break;

            default:
                $handler = new PrettyPageHandler();
        }

        $this->_whoops->pushHandler($handler);

        $this->_whoops->register();
        return $this;
    }
1047688
public static function startup()
    {
        global $PPHP;

        trigger('language', self::$_req['lang']);

        if (isset(self::$_PATH[1]) && listeners('route/' . self::$_PATH[0] . '+' . self::$_PATH[1])) {
            self::$_base = array_shift(self::$_PATH) . '+' . array_shift(self::$_PATH);
        } elseif (isset(self::$_PATH[0])) {
            if (listeners('route/' . self::$_PATH[0])) {
                self::$_base = array_shift(self::$_PATH);
            } else {
                trigger('http_status', 404);
            };
        } elseif (listeners('route/main')) {
            self::$_base = 'main';
        } else {
            trigger('http_status', 404);
        };
        self::$_req['path_args'] = self::$_PATH;
    }
657362
public function getFirstErrors()
    {
        $errors = array();
        foreach (array_keys($this->errors) as $name) {
            $errors[$name] = current($this->errors[$name]);
        }

        return $errors;
    }
1261060
protected function getError() {
		if ($this->_error === false) {
			if (is_resource($this->_dbh)) {
				$this->_error = @oci_error($this->_dbh);
			}
			else {
				$this->_error = @oci_error();
			}
		}

		return $this->_error;
	}
451146
public static function Start()
	{
		// Retrieve the global variables
		if(!$argv) $argv = $_SERVER["argv"];

		// Get the console variables
		$functionName = $argv[1];
		$rows = explode(",", $argv[2]);
		$vars = array();
		foreach($rows as $row)
		{
			$parts = explode("=", $row);
			$vars[$parts[0]] = $parts[1];
		}

		// Prepare the console
		$console = new Console;

		// Run the console
		try
		{
			return $console->Run($functionName, $vars);
		}
		catch(\Exception $ex)
		{
			return "\nError: " . $ex->getMessage() . "\n";
		}
	}
324956
public function startExceptionHandling()
    {
        $this['exception']->register($this->environment());

        //
        $debug = $this['config']['app.debug'];

        $this['exception']->setDebug($debug);
    }
1106433
public function getFirstError()
    {
        foreach ($this->models as $model) {
            if ($model->hasErrors()) {
                $errors = $model->getFirstErrors();

                return array_shift($errors);
            }
        }

        return false;
    }
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']);
		}
	}
56286
private function open()
    {
        // Used for trapping `fopen()` errors.
        $this->trappedErrorNumber = null;
        $this->trappedErrorString = null;

        set_error_handler(
            function($errorNo, $errorString) {
                $this->trapError($errorNo, $errorString);
            }
        );

        $needsChmod = !file_exists($this->file);
        $file = fopen($this->file, 'a');

        restore_error_handler();

        // Handles trapped `fopen()` errors.
        if ($this->trappedErrorNumber) {
            throw new Exception(
                sprintf(
                    "Logger Error: '%s'",
                    $this->trappedErrorString
                ),
                $this->trappedErrorNumber
            );
        }

        if ($needsChmod) {
            @chmod($this->file, $this->mode & ~umask());
        }

        return $this->file = $file;
    }
1029264
private function _openBag()
    {
        if ($this->_isCompressed()) {
            $this->bagDirectory = BagIt_uncompressBag($this->bag);
        } else {
            $this->bagDirectory = realpath($this->bag);
        }

        $this->bagitFile = "{$this->bagDirectory}/bagit.txt";
        list($version, $fileEncoding, $errors) = BagIt_readBagItFile(
            $this->bagitFile
        );
        $this->bagVersion = $version;
        $this->tagFileEncoding = $fileEncoding;
        $this->bagErrors = array_merge($this->bagErrors, $errors);

        $files = scandir($this->bagDirectory);
        if (count($files) > 0) {
            $bagdir = $this->bagDirectory;
            $manifestFile = findFirstExisting(
                array("$bagdir/manifest-sha1.txt", "$bagdir/manifest-md5.txt"),
                "$bagdir/manifest-sha1.txt"
            );
            try {
                $this->manifest = new BagItManifest(
                    $manifestFile,
                    $this->bagDirectory . '/',
                    $this->tagFileEncoding
                );
            } catch (Exception $exc) {
                array_push(
                    $this->bagErrors,
                    array('manifest', "Error reading $manifestFile.")
                );
            }

            if ($this->isExtended()) {
                $manifestFile = findFirstExisting(
                    array("$bagdir/tagmanifest-sha1.txt",
                    "$bagdir/tagmanifest-md5.txt"),
                    "$bagdir/tagmanifest-sha1.txt"
                );
                $this->tagManifest = new BagItManifest(
                    $manifestFile,
                    $this->bagDirectory . '/',
                    $this->tagFileEncoding
                );

                try {
                    $this->fetch = new BagItFetch(
                        "{$this->bagDirectory}/fetch.txt",
                        $this->tagFileEncoding
                    );
                } catch (Exception $exc) {
                    array_push(
                        $this->bagErrors,
                        array('fetch', 'Error reading fetch file.')
                    );
                }

                $this->bagInfoFile = "{$this->bagDirectory}/bag-info.txt";
                $this->_readBagInfo();
            }
        }
    }