Start the exception handling for the request.

@return void
324956
public function startExceptionHandling()
    {
        $this['exception']->register($this->environment());

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

        $this['exception']->setDebug($debug);
    }
208544
public function start() {
		$pid = @ pcntl_fork();
		if( $pid == -1 ) {
			throw new Exception( $this->getError( Thread::COULD_NOT_FORK ), Thread::COULD_NOT_FORK );
		}
		if( $pid ) {
			// parent
			$this->pid = $pid;
		}
		else {
			// child
			pcntl_signal( SIGTERM, array( $this, 'signalHandler' ) );
			$arguments = func_get_args();
			if ( !empty( $arguments ) ) {
				call_user_func_array( $this->runnable, $arguments );
			}
			else {
				call_user_func( $this->runnable );
			}

			exit( 0 );
		}
	}
405226
public function start()
    {
        $checker_checks = [
            'auth' => '',
            'role' => [],
        ];
        $checker_result = $this->dic['checker']->run($checker_checks);
        if (is_array($checker_result) && count($checker_result) == 0) {
            $this->response->setData((new ActionIndex($this->dic))->run());
        } else {
            $this->response->setData($checker_result);
        }

        $this->response->send();
    }
951953
public function handle()
    {
        $exception = $this->getException();

        Log::logger('ErrorHandler')->error($exception->getMessage(), [
            'exception' => get_class($exception),
            'file' => sprintf(
                "%s on line %d",
                $exception->getFile(),
                $exception->getLine()
            )
        ]);

        $template = new Template();

        $template = $template->initialize();
        $view = 'errors/500.html.twig';
        $code = 500;
        if (
            ($exception instanceof ControllerNotFoundException) ||
            ($exception instanceof ActionNotFoundException)
        ) {
            $view = 'errors/404.html.twig';
            $code = 404;
        }

        $data = ['exception' => $exception];
        $html = $template->parse($view)
            ->process($data);

        $this->app->response->setStatusCode($code)
            ->setContent($html);

        $this->app->response->send();
    }
1062308
public function start() {

        // indicate the library that it should execute queued requests
        $this->_queue = false;

        // if we have to pause between batches of requests, process them sequentially, in batches
        if ($this->pause_interval > 0) $this->_process_paused();

        // if we don't have to pause between batches of requests, process them all at once
        else $this->_process();

    }
223574
public function execAction()
    {
        //no action defined
        if(!$this->action) {
            throw new \Exception(sprintf('no action defined for subject %s', $this->name));
        }
        //exec method
        try {
            $this->checkTraitsInjections();
            $this->traitsInit();
            $this->{'exec'.$this->sanitizeAction($this->action)}();
        } catch(Exception $exception) {
        //no method defined
            throw new Exception(sprintf('no method for handling %s %s %s', AREA, $this->name, $this->action));
        }
    }
1211173
public function run() {
		if ($this->url === null) {
			throw new \Exception("No URL configured for redirection.");
		}
		if (strpos($this->url, '/') === 0 || strpos($this->url, 'http://') === 0 || strpos($this->url, 'https://') === 0) {
			$url = ValueUtils::val($this->url);
		} else {
			$url = ROOT_URL.ValueUtils::val($this->url);
		}
		header("Location: ".$url);
	}
667620
public function start()
    {
        $whoops  = new Run();
        $handler = new PrettyPageHandler();

        $handler->addResourcePath(__DIR__.'/Resources');
        $handler->setEditor('sublime');

        $whoops->pushHandler($handler);
        $whoops->register();

        $this->whoops = $whoops;
    }
896170
public function handleException()
    {
        /*
        | Exception handler registered here. So it will handle all
        | exceptions and thrown as pretty format
        |-----------------------------------
        | Enable pretty exception handler and
        | do necessary configuration
        |-----------------------------------
        */
        $config = Config::get('global.config');

        $this->enable($config['logs']['activate'], $config['logs']['path'])
            ->setTitle()
            ->setDebugger(Debugger::getBlueScreen())
            ->setEmailAddress(
                $config['logs']['email'],
                $config['logs']['error.emailing']
            )->run();
    }
1078313
public function exceptionHandler($e) : void
    {
        $this->setError(
            (int) $e->getCode(),
            (string) $e->getMessage(),
            (string) $e->getFile(),
            (int) $e->getLine(),
            (string) get_class($e),
            $e->getTrace()
        );

        View::render('500.php', (object) $this->errors);
    }
861756
public function boot()
    {
        if ((php_sapi_name() === 'cli' || defined('STDIN'))) {
            return;
        }

        if (session_status() == PHP_SESSION_ACTIVE) {
            throw new Exception('Session is already started');
        }

        // save path
        if ($this->app->hasProp($this->sessionPropName.'.save_path')) {
            session_save_path($this->app->getProp($this->sessionPropName.'.save_path'));
        }

        // save handler class
        if ($this->app->hasProp($this->sessionPropName.'.save_handler')) {
            session_set_save_handler($this->app->getProp($this->sessionPropName.'.save_handler'));
        }

        // name the session
        if ($this->app->hasProp($this->sessionPropName.'.name')) {
            session_name($this->app->getProp($this->sessionPropName.'.name'));
        }

        // session options
        $options = [];
        if ($this->app->hasProp($this->sessionPropName.'.options')) {
            $options = $this->app->getProp($this->sessionPropName.'.options');
        }

        // start the session
        session_start($options);
    }
271678
public function run()
    {
        if (is_callable($this->closure)) {
            // Set the error handler for the spec
            set_error_handler([$this, 'handleError'], E_ALL);

            // Invoke the closure while catching exceptions
            try {
                $this->closure->__invoke();
            } catch (ExpectationException $exception) {
                $this->exception = $exception;
            } catch (\Exception $exception) {
                $this->handleException($exception);
            }

            restore_error_handler();
        }
    }
414476
public function process(): void
    {
        try {
            $this->queue = msg_get_queue(ftok(__FILE__, 't'));
            $this->catchSignal();
            $this->initWorkerManager();
            $this->main();
        } catch (\Exception $e) {
            $this->logger->error('main() throw an exception, cleanup and exit', [
                'class' => get_class($this),
                'exception' => $e,
            ]);

            $this->cleanup(SIGTERM);
        }
    }
1178062
public function execute()
	{
		$query  = $this->factory->builder($this->update)->process();
		$result = $this->pdo->query($query);
		if(!$result)
		{
			throw new \Exception('An error while updating is occurred');
		}
	}
205397
public function Start()
    {
        if(!file_exists($this->definitions_path))
        {
            throw new \Exception(
                t("Trying to import symbols from a non existent directory.")
            );
        }
        
        $this->SendMessage(
            sprintf(
                t("Starting import of definitions stored in %s format."),
                $this->import_type
            )
        );
        
        if($this->import_type == Type::JSON)
        {
            $this->LoadFromJSON($this->definitions_path);
        }
        else
        {
            $this->LoadFromPHP($this->definitions_path);
        }
        
        $this->SendMessage(t("Import completed."));
    }
806764
public function handle() {
		if (\Skeleton\Core\Hook::exists('handle_error', [$this->exception])) {
			// If the error is handled within the application, no need to continue
			// internally.
			$this->last_handler = true;
			\Skeleton\Core\Hook::call('handle_error', [$this->exception]);
		}
	}
99638
public function run()
    {
        set_error_handler(array('\Slim\Slim', 'handleErrors'));

        //Apply final outer middleware layers
        $this->add(new \Slim\Middleware\PrettyExceptions());

        //Invoke middleware and application stack
        $this->middleware[0]->call();

        //Fetch status, header, and body
        list($status, $header, $body) = $this->response->finalize();

        //Send headers
        if (headers_sent() === false) {
            //Send status
            if (strpos(PHP_SAPI, 'cgi') === 0) {
                header(sprintf('Status: %s', \Slim\Http\Response::getMessageForCode($status)));
            } else {
                header(sprintf('HTTP/%s %s', $this->config('http.version'), \Slim\Http\Response::getMessageForCode($status)));
            }

            //Send headers
            foreach ($header as $name => $value) {
                $hValues = explode("\n", $value);
                foreach ($hValues as $hVal) {
                    header("$name: $hVal", false);
                }
            }
        }

        //Send body
        echo $body;

        restore_error_handler();
    }